Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku: bash: bundle: command not found

I am porting a Heroku app from Aspen to Cedar stack at Heroku, following their instructions.

I'm at the last deploy step. I get this error:

    2012-10-22T11:23:53+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -p 40310 -e production`
2012-10-22T11:23:54+00:00 app[web.1]: bash: bundle: command not found

I can't see how I can be responsible for telling the Heroku stack where bundle is, or providing it, since bundler is used by it for exactly this job. This command is specified in the Procfile for the app:

web: bundle exec thin start -p $PORT -e $RACK_ENV

Another similar question on stackoverflow suggests that this happens if the app is pushed to Heroku without a Procfile initially, so Heroku gets the wrong idea about what kind of app it is. That poster deleted his app and created a new one and reported success. However, the effort involved in deleting and recreating my ported app is high. Is there some way I can fix this rather than start over?

like image 821
GreenAsJade Avatar asked Oct 22 '12 21:10

GreenAsJade


Video Answer


1 Answers

Heroku's slug build process must have changed with regard to ruby 1.8.7 apps. I'm guessing they started bundling to 1.8 paths instead of 1.9.1 for 1.8 apps. My previously working app stopped working after I tried to push a new revision.

Here's what got it working again:

heroku config:add PATH=bin:vendor/bundle/1.8/bin:/usr/local/bin:/usr/bin:/bin GEM_PATH=vendor/bundle/1.8

I took these paths from a newly created app using the same git repository as I used before.

EDIT: Turns out that heroku published a devcenter article Changing Ruby Version Breaks Path that specifies paths for various ruby versions.

like image 182
adamlamar Avatar answered Oct 15 '22 02:10

adamlamar