Search code examples
ruby-on-railsherokubundlerbuildpack

Heroku-Buildpack-Multi causing app to crash


I'm have a Rails 4 app on Heroku that I'm trying to deploy with two buildpacks. I'm not sure if I'm missing a step or if there is a bug, but when I push the code, the app deploys successfully. When I open it however, it crashes.

I've tried using the command heroku buildpacks:set https://github.com/bobbus/image-optim-buildpack.git and heroku buildpacks:set https://github.com/ddollar/heroku-buildpack-multi.git, but am only able to set one at a time, not both. It doesn't seem to matter which one I set, the app always crashes. Searching through the logs, I see the following:

heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
app[web.1]: bash: bundle: command not found
heroku[web.1]: Process exited with status 127
heroku[web.1]: State changed from starting to crashed

I'm no expert on bundler, but it seems like for some reason it's not recognizing the bundle command in my Procfile.

Here is my Procfile, which I should note has worked perfectly up until now.

web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}

I've also tried clearing out the buildpacks (heroku buildpacks:clear) and creating a .buildpacks file instead, but that yielded the same error.

Here is my .builcpacks file:

https://github.com/ddollar/heroku-buildpack-multi.git
https://github.com/bobbus/image-optim-buildpack.git

The documentation in the Heroku Dev Center and on the buildpacks themselves is pretty sparse as far as I can tell.


Solution

  • If the two build packs you listed are the only two you're loading, I think you're missing the Ruby buildpack, which is where the "bundler" is defined:

    https://github.com/heroku/heroku-buildpack-ruby
    

    Note: If I were debugging this, I would ditch the buildpack-multi, and use just the Ruby buildpack to see if you can get that through the bundler error, then try to load another buildpack, and so on.


    I see what you mean about the documentation. Pretty weak. Let me know if this helps.