我想通过Rbenv运行安装了Ruby 2.1.1的脚本。这是我的暴发脚本:
start on runlevel [2345]
stop on runlevel [!2345]
setuid custom_user
setgid custom_user
script
cd /home/custom_user/application/ && rbenv shell 2.1.1 && bundle exec ruby script.rb
end script
如果我运行该命令记录为custom_user
它完美无缺。在application
目录中,我有Gemfile
。
Upstart给我以下错误消息:script main process (28879) terminated with status 127
答案 0 :(得分:4)
解决方案是指定bundle
的完整路径:
script
cd /home/custom_user/application/ && /home/custom_user/.rbenv/shims/bundle exec ruby script.rb
end script