我遇到了一个问题:我总是运行 cap production deploy Capistrano会将我的 config / routes.rb 覆盖为默认的rails代码。
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
有什么想法吗?
提前致谢!
CapFile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/nginx'
require 'capistrano/puma'
require 'capistrano/puma/nginx'
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
配置/ deploy.rb
lock '3.6.1'
set :application, 'demo-ror'
set :repo_url, '<my_git_repo>'
set :scm, :git
set :branch, :master
set :deploy_to, '/var/www/demo-ror'
set :tmp_dir, '/home/ubuntu/tmp'
set :pty, true
set :format, :airbrussh
set :format_options, command_output: true, log_file: 'log/capistrano.log', color: :auto, truncate: :auto
set :keep_releases, 5
set :keep_assets, 2
set :app_server, true
set :app_server_host, "127.0.0.1"
set :app_server_port, 8080
# nginx
...
# puma
...
配置/ routes.rb中
Rails.application.routes.draw do
root 'home#index'
end