5

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!

cobrabyte
  • 53
  • 1
  • 4

2 Answers2

5

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)

Community
  • 1
  • 1
Tom De Leu
  • 8,144
  • 4
  • 31
  • 30
  • 4
    See also the Heroku Devcenter article [Changing Ruby Version Breaks PATH](https://devcenter.heroku.com/articles/changing-ruby-version-breaks-path). – willglynn Nov 07 '12 at 22:04
  • 1
    I just received an email from Heroku on this and they recommended what you recommended. You can see the Heroku documentation on changing Ruby versions here: https://devcenter.heroku.com/articles/changing-ruby-version-breaks-path – cobrabyte Nov 07 '12 at 22:36
0

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.