Foreman开始返回未找到的包

时间:2012-12-16 17:11:43

标签: ruby ubuntu rvm bundler foreman

我最近从使用Ubuntu系统Ruby转向使用RVM。当我运行foreman start时,我的Procfile中的命令无法找到错误。

我当前的Procfile是:

web: bundle exec unicorn -p $PORT -c ./unicorn.rb

所以错误是:

/home/timmillwood/.rvm/gems/ruby-1.9.3-p327/gems/foreman-0.60.2/bin/foreman-runner: 41: exec: bundle: not found

which foreman返回

/home/timmillwood/.rvm/gems/ruby-1.9.3-p327/bin/foreman

which bundle返回

/home/timmillwood/.rvm/gems/ruby-1.9.3-p327/bin/bundle

rvm info的输出是:

ruby-1.9.3-p327:

  system:
    uname:       "Linux ubuntu 3.5.0-19-generic #30-Ubuntu SMP Tue Nov 13 17:48:01 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux"
    system:      "ubuntu/12.10/x86_64"
    bash:        "/bin/bash => GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.17.3 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "1 hour 10 minutes 26 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p327"
    date:         "2012-11-10"
    platform:     "x86_64-linux"
    patchlevel:   "2012-11-10 revision 37606"
    full_version: "ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]"

  homes:
    gem:          "/home/timmillwood/.rvm/gems/ruby-1.9.3-p327"
    ruby:         "/home/timmillwood/.rvm/rubies/ruby-1.9.3-p327"

  binaries:
    ruby:         "/home/timmillwood/.rvm/rubies/ruby-1.9.3-p327/bin/ruby"
    irb:          "/home/timmillwood/.rvm/rubies/ruby-1.9.3-p327/bin/irb"
    gem:          "/home/timmillwood/.rvm/rubies/ruby-1.9.3-p327/bin/gem"
    rake:         "/home/timmillwood/.rvm/gems/ruby-1.9.3-p327@global/bin/rake"

  environment:
    PATH:         "/home/timmillwood/.rvm/gems/ruby-1.9.3-p327/bin:/home/timmillwood/.rvm/gems/ruby-1.9.3-p327@global/bin:/home/timmillwood/.rvm/rubies/ruby-1.9.3-p327/bin:/home/timmillwood/.rvm/bin:/usr/local/heroku/bin:/home/timmillwood/Support-Tools/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
    GEM_HOME:     "/home/timmillwood/.rvm/gems/ruby-1.9.3-p327"
    GEM_PATH:     "/home/timmillwood/.rvm/gems/ruby-1.9.3-p327:/home/timmillwood/.rvm/gems/ruby-1.9.3-p327@global"
    MY_RUBY_HOME: "/home/timmillwood/.rvm/rubies/ruby-1.9.3-p327"
    IRBRC:        "/home/timmillwood/.rvm/rubies/ruby-1.9.3-p327/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

我也尝试过使用rbenv完全相同的问题。 Foreman工作得很好,我使用的是系统ruby,但是我已经从Ubuntu清除了这些并希望使用RVM或rbenv,所以我可以运行Ruby 1.9和1.8。

好像工头找不到捆绑二进制文件。我可以运行bundle exec ruby web.rbruby web.rb来运行sinatra应用程序,但这失败了,因为它没有像工头一样从.env加载我的环境变量。我可以使用rack-env加载我的.env文件,然后使用ruby web.rb加载我的sinatra应用程序,但宁可使用foreman。

任何想法有什么不对?

2 个答案:

答案 0 :(得分:13)

结果我在PATH生成的.env文件中覆盖了heroku config:pull。删除该行已解决问题。

谢谢大家,没有什么可看的。

答案 1 :(得分:1)

~/.profile之类的接缝可能会覆盖PATH - &gt; https://github.com/ddollar/foreman/blob/master/bin/foreman-runner#L37,确保PATH=...中没有~/.profile或其中任何其他文件。