Jeremy Thomas
Jeremy Thomas

Reputation: 6674

Heroku: Cannot push to Heroku due to gem install bundler

All of a sudden I cannot push to Heroku and I get to the point where the build has succeeded, but then on compilation I see the following:

remote: -----> Build succeeded!
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: sh: 1: gem-install-bundler: not found
remote: sh: 1: gem-install-bundler: not found
remote:  !
remote:  !     An error occurred while installing ruby-2.2.3-The-latest-bundler-is-1.15.2,-but-you-are-currently-running-1.15.1.-To-update,-run-`gem-install-bundler`
remote:  !     
remote:  !     Heroku recommends you use the latest supported Ruby version listed here:
remote:  !     https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote:  !     
remote:  !     For more information on syntax for declaring a Ruby version see:
remote:  !     https://devcenter.heroku.com/articles/ruby-versions
remote:  !     
remote:  !     
remote:  !     Debug InformationCommand: 'set -o pipefail; curl -L --fail --retry 5 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/cedar-14/ruby-2.2.3-The-latest-bundler-is-1.15.2,-but-you-are-currently-running-1.15.1.-To-update,-run-`gem-install-bundler`.tgz -s -o - | tar zxf - ' failed unexpectedly:
remote:  !     bash: gem-install-bundler: command not found
remote:  !     
remote:  !     gzip: stdin: unexpected end of file
remote:  !     tar: Child returned status 1
remote:  !     tar: Error is not recoverable: exiting now
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed

From what I could gather, I figured I needed to update bundler, so I updated bundler to version 1.15.2, and attempted to push it up again, but the same error is shown. My gemfile.lock even says BUNDLED WITH 1.15.2.

Is there something I am missing?

Upvotes: 0

Views: 266

Answers (2)

Jeremy Thomas
Jeremy Thomas

Reputation: 6674

I reached out to Heroku and they showed me that I had multiple buildpacks:

Thanks for contacting us regarding issue around installation of ruby. It seems that the app has Heroku Buildpack for Ruby specified twice, with the latter specifying the master version rather than the released version:

$ heroku buildpacks -a app-name
=== app-name Buildpack URLs
1. heroku/ruby
2. https://github.com/heroku/heroku-buildpack-nodejs.git
3. https://github.com/heroku/heroku-buildpack-ruby.git

They then continued to show me how to solve the issue:

Could you please try specifying each of buildpacks once as well as using the released versions to see if the problem pertists?

$ heroku buildpacks:remove -i 3 -a app-name
$ heroku buildpacks:remove -i 2 -a app-name
$ heroku buildpacks:remove -i 1 -a app-name
$ heroku buildpacks:add heroku/nodejs -a app-name
$ heroku buildpacks:add heroku/ruby -a app-name
$ git push heroku master

and this solved everything!

Upvotes: 1

maverick5
maverick5

Reputation: 181

did you Check the resulting Gemfile.lock into version control

git add Gemfile.lock

Upvotes: 0

Related Questions