0

What is the most efficient way of upgrading Ruby on Mac OS High Sierra?

I am trying to deploy my simple Ruby app onto Heroku.

I am running the command:

git push heroku master

However, I am getting the following error:

18:11 $ git push heroku master
Counting objects: 97, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (82/82), done.
Writing objects: 100% (97/97), 22.59 KiB | 1.88 MiB/s, done.
Total 97 (delta 8), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote:  !     Warning: Multiple default buildpacks reported the ability to 
handle this app. The first buildpack in the list below will be used.
remote:                         Detected buildpacks: Ruby,Node.js
remote:                         See 
https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote:        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.3.tgz -s -o - | tar 
zxf - ' failed on attempt 1 of 3.
remote:        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.3.tgz -s -o - | tar 
zxf - ' failed on attempt 2 of 3.
remote:
remote:  !
remote:  !     An error occurred while installing ruby-2.3.3
remote:  !
remote:  !     This version of Ruby is not available on Heroku-18. The 
minimum supported version
remote:  !     of Ruby on the Heroku-18 stack can found at:
remote:  !
remote:  !     https://devcenter.heroku.com/articles/ruby-support#supported- 
runtimes
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to morning-plains-67699.
remote: 
To https://git.heroku.com/morning-plains-67699.git
! [remote rejected] master -> master (pre-receivehook declined)
error: failed to push some refs to 'https://git.heroku.com/morning-plains- 
67699.git'
ivsuleman
  • 366
  • 4
  • 9
  • might help you https://stackoverflow.com/questions/44305305/heroku-is-not-using-the-ruby-version-mentioned-in-gemfile – Santosh Sharma Jan 29 '19 at 10:41
  • I think the error message is quite clear. Update your application to a newer, up-to-date Ruby version and retry. – spickermann Jan 29 '19 at 13:39
  • I have done this using RVM but I still get the same error. – ivsuleman Jan 29 '19 at 17:58
  • You can downgrade heroku stack to solve this issue. Solution can be found here https://stackoverflow.com/questions/53354444/how-can-i-solve-this-trouble-to-deploy-a-rails-app-to-heroku?answertab=active#tab-top – Dipak Gupta Mar 08 '19 at 09:16

3 Answers3

0

Heroku doesn't support Ruby 2.3.3

Heroku supports the following Ruby versions and the associated Rubygems. A supported version means that you can expect our tools and platform to work with a given version. It also means you can receive technical support. Here are our supported Ruby versions:

MRI:

  • 2.4.5 : patchlevel 335, Rubygems: 2.6.14.3
  • 2.5.3: patchlevel 105, Rubygems: 2.7.6
  • 2.6.0: patchlevel 0, Rubygems: 3.0.1

Read at Heroku

Also read information how to specify Ruby version.

Community
  • 1
  • 1
mechnicov
  • 12,025
  • 4
  • 33
  • 56
0

Check the latest version of ruby in this link https://devcenter.heroku.com/articles/ruby-support#supported-runtimes

then run the latest one rvm install ruby-2.4.6

type ruby -v in the terminal, you should see ruby 2.4.6.

If it still shows you ruby 2.0., run rvm use ruby-2.4.6 --default.

Change the ruby version in your gem file then bundle

This solve my problem

nourza
  • 2,215
  • 2
  • 16
  • 42
0

I had the same or similar error. In my case I did check the branches of the remote , git remote show heroku.

I had a branch main , but no a master , so I made a git checkout

git checkout -b main

And then

git push heroku main

Everything was resolved.

Nico JL
  • 409
  • 3
  • 6