我正在关注#335 Deploying to a VPS。在deploy.rb
,
%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
结尾
当我跑步时cap deploy:start
,我得到了sh: /etc/init.d/unicorn_appname: Permission denied
。但是,如果我将 run 更改为 sudo: sudo "/etc/init.d/unicorn_#{application} #{command}"
,我会得到sudo: /etc/init.d/unicorn_appname: command not found
.
那么该命令真的不存在,或者sudo
彼此run
不同吗?