In my .ruby-version and Gemfile the ruby 2.5.0
is specified. When I run "ruby -v", I get "2.5.0". However, when deploying to Heroku, I get this error:
Your Ruby version is 2.4.2, but your Gemfile specified 2.5.0
Why? How to fix it?
In my .ruby-version and Gemfile the ruby 2.5.0
is specified. When I run "ruby -v", I get "2.5.0". However, when deploying to Heroku, I get this error:
Your Ruby version is 2.4.2, but your Gemfile specified 2.5.0
Why? How to fix it?
According to https://devcenter.heroku.com/articles/ruby-versions#troubleshooting following causes this issue
Gemfile
and Gemfile.lock
If ruby -v
is outputting 2.5.0
, you may need to update Gemfile.lock
. The best way to do that is using bundler.
Check the Gemfile.lock
file in your project's root to see which version of Ruby it references. It likely will say ruby 2.4.2
.
Running either bundle update
or bundle install
should get your Gemfile
and Gemfile.lock
matched up again.
At first update The Ruby version installed in your PC/ Laptop (If Any)!!.
Delete the ruby " [version number] " which is written in gemfile,
just Tweak the Version to The Upgraded version installed in your PC .. <3