【问题标题】:bundle not found when running services using upstart/foreman使用 upstart/foreman 运行服务时找不到捆绑包
【发布时间】:2014-03-07 09:16:42
【问题描述】:

我正在为 Ubuntu 12.04 上的 Rails 4 应用程序设置暂存环境。 我用: - rbenv 用于管理红宝石 - 用于部署的 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

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

我错过了什么吗?

谢谢。

【问题讨论】:

    标签: ruby-on-rails rbenv foreman


    【解决方案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" 
    

    【讨论】:

      猜你喜欢
      • 2011-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多