[英]Use upstart to run a ruby script with rbenv install ruby
我想在通過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
。
新貴給我以下錯誤消息: script main process (28879) terminated with status 127
解決方案是指定bundle
的完整路徑:
script
cd /home/custom_user/application/ && /home/custom_user/.rbenv/shims/bundle exec ruby script.rb
end script
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.