heroku: bash: bundle: command not found

。_饼干妹妹 提交于 2019-12-01 17:05:06

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.

I had the same issue and I solved it by setting the correct heroku config variables

$ heroku config
=== xxxx Config Vars
DATABASE_URL:                  postgres://(...)
GEM_PATH:                      vendor/bundle/ruby/1.9.1
HEROKU_POSTGRESQL_CRIMSON_URL: postgres://(...)
LANG:                          en_US.UTF-8
PATH:                          bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
PGBACKUPS_URL:                 https://(...)
RACK_ENV:                      production
RAILS_ENV:                     production

you can create an empty rails app, push it to heroku and check the variables it automatically set, then copy (and adapt) them to your application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!