【发布时间】:2014-09-07 09:40:57
【问题描述】:
我想在部署后重新启动瘦 Web 服务器。为此,我在config/deploy.rb 中有以下代码:
namespace :deploy do
desc 'Restart application...'
task :restart do
on roles(:app) do
within "#{current_path}" do
execute "bundle exec thin -C /etc/thin/app.yml restart"
end
end
end
(...)
所以我想在当前路径文件夹中执行bundle exec thin -C /etc/thin/app.yml restart命令。
这会引发错误:
SSHKit::Runner::ExecuteError: 在主机上执行时出现异常 ...: bundle exec thin -C /etc/thin/reboot.yml restart exit status: 127
/EDIT 首先显示另一个错误,因为早期代码中存在语法错误。用户RAJ 在下面的回答中发现了此错误
此任务出现同样的错误:
task :restart do
on roles(:app) do
within "#{current_path}" do
execute :bundle, "thin -C /etc/thin/reboot.yml restart"
end
end
如何从部署脚本运行捆绑包?
【问题讨论】:
标签: ruby-on-rails ruby deployment capistrano