Upgrade issues | ruby version mismatch?

It’s been a couple years… My app stopped running on Heroku. Tried changing to Heroku-22 stack. I’m also moving from Windows dev machine to Mac M1.

What might cause this?

rails -v
Your Ruby version is 2.6.10, but your Gemfile specified 2.7.6
ruby -v
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [arm64-darwin21]


source 'https://rubygems.org'
git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
ruby '2.7.6'
gem 'rails', '~> 5.2.8'
# gem 'sqlite3'
gem 'pg'
gem 'puma', '~> 3.7'

You need to install and configure one (only) of the following: rvm, rbenv, chruby, asdf (and maybe there are others). I’ve been using rvm since it was released, we use rbenv at my day job. They all basically do the same job – get a chosen ruby into your path, and allow you to change between different versions as you move from project to project.

The version that your terminal is reporting to you is the version installed by Apple with the OS and Developer Tools. You should avoid using that for anything at all, except maybe any Mac-specific tools that depend on it.

For the same reason as alluded to above (switching projects) you should also avoid installing another version of Ruby using Homebrew or another tool like it. You want to be able to choose.



I think it was an outdated bundler or ruby gems. Once I updated those, I could go ahead.