JSON K.
JSON K.

Reputation: 131

How To Keep Ruby Updated on Mac

I keep updating my Ruby to the newest version, and it somehow keeps reverting back to the old version I had installed, 2.3.7. I'm confused how or why this is happening? How can I keep it on the newest version on my computer?

Upvotes: 1

Views: 868

Answers (2)

7urkm3n
7urkm3n

Reputation: 6321

Suggesting to work with rvm or rbenv

rvm - rvm documentation

Installation:

RVM - copy/paste to terminal the url below.

\curl -sSL https://get.rvm.io | bash -s stable --ruby

Make sure to restart terminal after installing RVM environment has to be loaded.

Usage:

rvm list - see all installed or available ruby version in the machine.

rvm install ruby-2.5.1 - installing ruby 2.5.1 version

rvm use 2.5.1 - using specific version

rvm use --default 2.5.1 - to make it default

Upvotes: 2

tadman
tadman

Reputation: 211670

You need to pin the default version:

rvm use --default 2.5.3

Then check that's applied by opening a new shell:

rvm list

If it's not staying pinned it possible RVM isn't properly initialized in your shell. Check that the .profile or .bash_profile or .bashrc or whatever shell you're using has the right RVM environment setup at the bottom.

Upvotes: 3

Related Questions