使用Capistrano 2.15.5进行部署工作正常,但部署后运行的一个任务重新启动DelayedJob工作程序除外。
它告诉我:
Could not find addressable-2.3.6 in any of the sources
Run `bundle install` to install missing gems.
...
failed: "sh -c 'RAILS_ENV=production /home/docs/apps/myapp/current/bin/delayed_job restart'"
然而,安装了gem。当我在服务器上复制并粘贴该命令时,它运行正常。
以下是我的deploy.rb的相关部分:
set :user, 'same-user-that-can-execute-commands-successfully-on-server'
set :use_sudo, false
after "deploy:cleanup", "deploy:restart_dj"
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
task :restart_dj, :roles => :app, :except => { :no_release => true } do
run "RAILS_ENV=production #{File.join(current_path,'bin','delayed_job')} restart"
end
end