0

I am working on macOS.

brew upgrade ruby
Warning: ruby 3.1.2 already installed

but doing

ruby -v 

would get me

ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

I tried

whereis ruby

and it is giving me

/usr/bin/ruby

I want version 3.1.2 to appear when doing ruby -v, but I ran out of idea on how to make my machine default to version 3.1.2 . Any suggestion?

nerd
  • 473
  • 5
  • 15
  • 2
    Use `rbenv`? That's the usual thing... Homebrew installs it but initializing and configuring it is up to you. – matt Jul 23 '22 at 13:15

1 Answers1

1

It might be easier if you use a ruby version manager like rbenv or rvm

brew install rbenv 
rbenv install 3.1.2
rbenv use 3.1.2

Otherwise, you can check this answer: https://stackoverflow.com/a/8731098/14473816

Nathan
  • 38
  • 5