I have a Rails 3.2.3 app that I'm trying to push to Heroku using Ruby 2.0.0preview1 (see: http://blog.heroku.com/archives/2012/11/5/ruby-2-preview-on-heroku/).

This is an application that has been functioning properly under Ruby 1.9 and should have no issues under Ruby 2.0.0.

The errors I'm encountering are:

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

I logged into Heroku via bash and installed Bundler (gem install bundler) but that didn't help. I also tried changing the GEM_PATH environment variable but that doesn't seem to do anything either.

I'm racking my brain on how to fix this one. Any help is appreciated!

有帮助吗?

解决方案

I had the same thing: solved it by creating a new Heroku app with Ruby 2.0.0 and looking at the output of "heroku config" of my app vs the new app. Then I noticed that both GEM_PATH and PATH were different, so I did:

$ 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

And presto, error's gone!

(got the idea from: heroku: bash: bundle: command not found)

其他提示

I just fixed this issue for a coworker. Make sure your buildpack is the correct one.Ie: if you use ruby make sure it is heroku/ruby. We changed it from node.js to the ruby build pack.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top