使用upstart / foreman运行服务时找不到捆绑包

时间:2014-03-07 09:16:42

标签: ruby-on-rails rbenv foreman

我正在为Ubuntu 12.04上的Rails 4应用程序设置一个暂存环境。 我用:   - 用于管理红宝石的rbenv   - deployemnt的capistrano   - 管理服务的领班

特别是,我想将que作为服务运行。我的Procfile看起来像

que: bundle exec rake que:work

我已成功导出了upstart的Procfile。我的sapp-que-1.conf看起来像

start on starting ft-id-que
stop on stopping ft-id-que
respawn

exec su - deployer -c 'cd /home/deployer/apps/sapp/releases/20140307080502; export PORT=5000; bundle exec rake que:work  >> /home/deployer/apps/sapp/current/log/que-1.log 2>&1'

当我尝试启动它时(sudo start sapp)我收到以下错误:

-su: bundle: command not found

但是,如果我进入/ home / deployer / apps / sapp / releases / 20140307080502并手动运行bundle exec rake que:work,则执行rake。

我在这里遗漏了什么吗?

感谢。

1 个答案:

答案 0 :(得分:1)

你能拥有.bash_profile吗?

su未读取.bashrc

[SOLVED] Special user, .bashrc not being executed upon login

我使用

创建.bash_profile
# Load the default .profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" 

# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
相关问题