0

I forked and cloned a repo so I could deploy to Heroku - then I got the message below asking to upgrade the project Ruby version.

! The Ruby version you are trying to install does not exist on this stack. !
! You are trying to install ruby-2.7.4 on heroku-22. !
! Ruby ruby-2.7.4 is present on the following stacks: !
! - heroku-18 ! - heroku-20 !
! Heroku recommends you use the latest supported Ruby version listed here: ! https://devcenter.heroku.com/articles/ruby-support#supported-runtimes !
! For more information on syntax for declaring a Ruby version see: ! https://devcenter.heroku.com/articles/ruby-versions ! ! Push rejected, failed to compile Ruby app. ! Push failed

In my Mac when I run ruby -v I get 3.1.2 version. When I go into the project's Gemfile and type the old version to the latest, I run bundle install but I get this message:

rbenv: version `2.7.4' is not installed (set by /Users/luciamoral/code/Luciamoral/Driven-App/.ruby-version)

Does this mean I need to also install the oldest version so it works? Also, I found that it is not recording changes when I push to origin master, despite having forked and cloned it to my machine. Any ideas please? Thanks!

1
  • Did bundle say something like Your Ruby version is 3.1.2, but your Gemfile specified 2.7.4? Commented Jan 19, 2023 at 18:17

1 Answer 1

0

You have the Ruby version specified in two places, .ruby-version and Gemfile. Only use one. Heroku only cares about the Gemfile.

Your options are to either downgrade to a version of the heroku stack which supports your version of Ruby, which just pushes off the problem, or upgrade your Ruby version.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks a lot Schwern, I have upgraded to latest version and successfully deployed to Heroku. Now I need to debug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.