Why does rvm expect version Ruby 2.6 when both Gemfile and path have 2.7.1?

229 views Asked by At

I’m using Mac OS Big Sur (11.6) with Rails 6.2, Ruby 2.7 and bash shell. I’m noticing when I switch into my directory where my project is I get this message

$ cd ~/Documents/workspace//my-project/
Required ruby-2.6.7 is not installed.
To install do: 'rvm install "ruby-2.6.7"'

This is odd because Ruby 2.7 is on my path and in my Gemfile

$ which ruby
/Users/myuser/.rvm/rubies/ruby-2.7.1/bin/ruby

The Gemfile having this at the top

fail "run 'gem install bundler' to update your bundler version" unless Bundler::VERSION >= '2.0.0'
source 'https://rubygems.org'
ruby '~> 2.7.1'

I have this in my ~/.bash_profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

But am unsure what else to check to remove this error message. Why is it expecting Ruby 2.6 and how can I make it expect the proper version?

1

There are 1 answers

0
arnold bwaila On

Your ruby install has to be in the root directory.