heroku: bash: bundle: command not found

前端 未结 2 1197
轻奢々
轻奢々 2021-01-18 07:07

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:

    20         


        
相关标签:
2条回答
  • 2021-01-18 07:31

    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.

    0 讨论(0)
  • 2021-01-18 07:45

    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

    0 讨论(0)
提交回复
热议问题