Jae
Jae

Reputation: 1167

This version of Ruby is not available on Heroku-18

When I try to build my app on Heroku, it fails because the Ruby version I purportedly am using is not supported by Heroku. My app has no problem building/deploying locally. Here is full message log:



-----> Ruby app detected

-----> Compiling Ruby/Rails

       Command: '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/heroku-18/ruby-2.3.8.tgz -s -o - | tar zxf - ' failed on attempt 1 of 3.

       Command: '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/heroku-18/ruby-2.3.8.tgz -s -o - | tar zxf - ' failed on attempt 2 of 3.

 !

 !     An error occurred while installing ruby-2.3.8

 !     

 !     This version of Ruby is not available on Heroku-18. The minimum supported version

 !     of Ruby on the Heroku-18 stack can found at:

 !     

 !     https://devcenter.heroku.com/articles/ruby-support#supported-runtimes

 !

 !     Push rejected, failed to compile Ruby app.

 !     Push failed

However, in my Gemfile and Gemfile.lock, I am NOT using ruby-2.3.8. That is why I am very confused. I have links to my Gemfile gist and Gemfile.lock gist.

Things I have tried on Heroku:

Running bundle install.

This. Did not resolve issue, my Gemfile, Gemfile.lock, and local Ruby is ALL 2.6.3.

Making sure Gemfile and Gemfile.lock are the most recent ones in my Github.

Running gem install bundler -v 1.17.3 but it gives me ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /var/lib/gems/2.5.0 directory

EDIT:

It appears after running heroku run ruby -v, that my Ruby version is actually ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]

Upvotes: 0

Views: 1081

Answers (2)

gwcodes
gwcodes

Reputation: 5690

It's possible that the "blessed" version of bundler hasn't been updated yet to 2.0.2, and only 2.0.1 is supported on the official ruby buildpack.

To test this out, you can edit your Gemfile.lock manually and change:

BUNDLED WITH
  2.0.2

to 2.0.1

It will be overridden every time you bundle though, so if that is the fix, you might want to downgrade bundler for the time being.

Upvotes: 2

Don M
Don M

Reputation: 986

On Heroku you cannot configure the version of bundler directly -> https://devcenter.heroku.com/articles/bundler-version#app-not-using-the-currently-supported-bundler-version

I am guessing you are using the heroku buildpack, if not you will want to set that up.

You can switch to a supported buildpack with:

heroku buildpacks:set heroku/ruby

I believe I have had issues where heroku wasn't updating, try the top 2 answers here: Heroku is not updating my code?

One of the pitfalls of heroku is you will need to work with in their construct. I would make sure you are using whatever version of bundler and ruby they want locally prior to deployment and after deployment confirm by sshing on to the heroku box to confirm it is the same version.

Sidenote, using the ruby keyword will only work for certain versions of bundler https://devcenter.heroku.com/articles/ruby-versions#selecting-a-version-of-ruby

I usually set my ruby version in a .ruby-version file in the root of the project.

Upvotes: 1

Related Questions