Brian Nicholls
Brian Nicholls

Reputation: 15

Ruby -v shows 2.6.3, but Terminal says I'm running 2.3.7 when trying to run rails console

I just updated ruby, and running ruby -v in terminal shows: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]

However, when trying to run rails console, I get the error:

Rails 6 requires Ruby 2.5.0 or newer.

You're running
  ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

Please upgrade to Ruby 2.5.0 or newer to continue.

Which is the version I just (allegedly) updated from. Any help is greatly appreciated.

Upvotes: 0

Views: 946

Answers (2)

Brian Nicholls
Brian Nicholls

Reputation: 15

I had to run rvm implode , then re-install rvm. Then I followed the instructions found here: How to update Ruby Version 2.0.0 to the latest version in Mac OSX Yosemite?

Thank you!

Upvotes: 0

Khanh Pham
Khanh Pham

Reputation: 2973

Because in your local development, you had some ruby versions which was installed, and it set ruby 2.3.7 as default.

If you installed ruby via rvm, you can check and list all ruby versions in your local via command:

rvm list

For examples:

   ruby-2.6.0 [ x86_64 ]
=* ruby-2.6.2 [ x86_64 ]
   ruby-2.6.3 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

As you see, you can use this command as bellow to set default ruby to use.

rvm use 2.6.3 --default

Upvotes: 1

Related Questions