我正在使用 Capistrano 来部署我的 Rails 应用程序。每当我部署时,更改都不会反映在浏览器上,我仍然需要重新启动 nginx 来更新站点(运行 sudo /etc/init.d/nginx restart)。我不太确定为什么,但它不应该在重新启动应用程序后更新吗?(使用触摸/app/tmp/restart.txt)
这是我的 deploy.rb
require "rvm/capistrano"
set :rvm_ruby_string, 'ruby-1.9.3-p194@app_name'
set :rvm_type, :user
require "bundler/capistrano"
set :application, "app_name"
set :user, "me"
set :deploy_to, "/home/#{user}/#{application}"
set :deploy_via, :copy
set :use_sudo, false
set :scm, :git
set :repository, "~/Sites/#{application}/.git"
set :branch, "master"
role :web, '1.2.3.4'
role :app, '1.2.3.4'
role :db, '1.2.3.4', :primary => true
role :db, '1.2.3.4'
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end