设置Rails 8 不使用默认的Kamal


因为国内访问Docker存在一些问题,不能直接使用Kamal,可以选择传统的部署方式,the Traditional VPS Setup。
Traditional VPS Setup: You can deploy to a Virtual Private Server (VPS) using a reverse proxy (like Nginx or Caddy) in front of your application server (Puma). You can manage the process with tools like systemd.

To use Rails 8 without Kamal, you can either 
skip the Kamal setup when creating a new application or simply ignore the generated Kamal files and use traditional deployment methods. Rails 8 works fine with standard deployment practices that predate Kamal. 

Option 1: Skip Kamal When Creating a New App

The easiest way to avoid Kamal is to use the --skip-kamal flag when generating a new Rails application: 

bash
rails new your_app_name --skip-kamal

This command prevents Rails from adding the kamal gem to your Gemfile and running kamal init during setup. 

Option 2: Ignore Kamal in an Existing App

If you already created an app with default settings, Rails includes Kamal by default. You are free to ignore the generated kamal related files (config/deploy.yml and potentially a Dockerfile in older beta versions) and the kamal gem in your Gemfile. 
阅读量: 136
发布于:
修改于: