簡體   English   中英

使用upstart通過rbenv install ruby​​運行ruby腳本

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM