Marty
Marty

Reputation: 2224

Failed to push to Heroku: fails on Ruby version

When I push to Heroku I get the following error:

remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote:        Your app was upgraded to bundler 1.13.6.
remote:        Previously you had a successful deploy with bundler 1.11.2.
remote:        
remote:        If you see problems related to the bundler version please refer to:
remote:        https://devcenter.heroku.com/articles/bundler-version
remote: -----> Using Ruby version: ruby-2.3.0
remote: -----> Installing dependencies using bundler 1.13.6
remote:        Ruby version change detected. Clearing bundler cache.
remote:        Old: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
remote:        New: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Your Ruby version is 2.3.0, but your Gemfile specified 2.3.1
remote:        Bundler Output: Your Ruby version is 2.3.0, but your Gemfile specified 2.3.1
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed

It works locally. Locally, ruby -v returns ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]. rvm list rubies gives the following:

   ruby-1.9.3-p551 [ x86_64 ]
   ruby-2.1.5 [ x86_64 ]
   ruby-2.2.1 [ x86_64 ]
=* ruby-2.3.1 [ x86_64 ]

How to solve this issue? Is Heroku not yet accepting Ruby 2.3.1? I could of course switch back locally to version 2.3.0 but I would expect this not to be necessary?

Upvotes: 0

Views: 692

Answers (1)

Thanh
Thanh

Reputation: 8624

You can run gem install bundler, then bundle install to update your Ruby version in Gemfile.lock so that the app can use correct Ruby version specified in Gemfile.

Upvotes: 1

Related Questions