我有一个Rails 3.2.3应用程序,我正在尝试使用Ruby 2.0.0preview1推送到Heroku(参见:http://blog.heroku.com/archives/2012/11/5/ruby-2-preview-on-heroku/)。
这是一个在Ruby 1.9下运行正常的应用程序,在Ruby 2.0.0下应该没有问题。
我遇到的错误是:
2012-11-07T15:19:32+00:00 heroku[web.1]: State changed from crashed to starting
2012-11-07T15:19:37+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -p 3225 -c ./config/unicorn.rb`
2012-11-07T15:19:38+00:00 app[web.1]: bash: bundle: command not found
2012-11-07T15:19:39+00:00 heroku[web.1]: Process exited with status 127
2012-11-07T15:19:39+00:00 heroku[web.1]: State changed from starting to crashed
我通过bash登录Heroku并安装了Bundler(gem install bundler),但这没有帮助。我也尝试更改GEM_PATH环境变量,但似乎也没有做任何事情。
我正在绞尽脑汁想要解决这个问题。任何帮助表示赞赏!
答案 0 :(得分:5)
我有同样的事情:通过使用Ruby 2.0.0创建一个新的Heroku应用程序并查看我的应用程序的“heroku配置”与新应用程序的输出来解决它。 然后我注意到GEM_PATH和PATH都不同,所以我做了:
$ heroku config:set GEM_PATH=vendor/bundle/ruby/2.0.0
$ heroku config:set PATH=bin:vendor/bundle/ruby/2.0.0/bin:/usr/local/bin:/usr/bin:/bin
然后,错误消失了!
(得到了这个想法:heroku: bash: bundle: command not found)
答案 1 :(得分:0)
我刚刚为同事解决了这个问题。确保你的buildpack是正确的。例如:如果你使用ruby,请确保它是heroku / ruby。我们将它从node.js更改为ruby构建包。