我正在关注#335 Deploying to a VPS,当我运行时cap deploy:cold
,一切都很好,除了最后它报告
executing 'deploy:start'
executing "/etc/init.d/unicorn_just4magic start"
servers: ["106.XXX.XXX.XXX"]
[106.XXX.XXX.XXX] executing command
out :: 106.XXX.XXX.XXX sh: /etc/init.d/unicorn_just4magic: Permission denied
command finished in 502ms
failed: "env PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH sh -c '/etc/init.d/unicorn_just4magic start'" on
106.XXX.XXX.XXX
我可以rails server
在VPS上手动运行,完全没有问题。但是在使用 cap 进行部署时,我得到了上述错误。当我访问我的网站时,我会得到Sorry Something went wrong
提示
更新: deploy.rb 在这里,这是start/restart
部分
%w[start stop restart].each do |command|
desc "#{command} unicorn server"
task command, roles: :app, except: {no_release: true} do
run "/etc/init.d/unicorn_#{application} #{command}"
end
end
UPDATE2:现在permission denied
提示没有出现,我遇到了另一个问题:
sudo: /etc/init.d/unicorn_just4magic: command not found
我发现Capistrano deploy:start with unicorn和在 cap deploy:cold - command not found for /etc/init.d/unicorn
我更改了 shell 脚本的行分隔符,并gemfile.lock
从 git 和 set :bundle_flags, ''
. 仍然得到错误