rvm is a necessary tool to run different version of ruby.
Once in a while I need to upgrade ruby version, but rvm’s official doc is a bit too dense.
Beyond installing, there are just a few commands that you really need.
Install the latest
rvm install ruby --latest
Or manually specify a version with
rvm install ruby 2.0.0-p247
Set the default version
rvm --default use ruby-2.6.3
default option is often needed, because without it, when you reload the terminal or restart the computer, it will use back the previous.
To confirm the version in use:
ruby -v which ruby
# List my rubies rvm list # List all the known rubies rvm list known # Update rvm and known rubies rvm get stable