How to install Ruby on macOS using RVM
In this article, I’m going to show you how to install Ruby with RVM on a macOS machine. You’ll also learn how to install a specific version.
Install GPG
brew install gpg
Install RVM
RVM stands for Ruby Version Manager. It allows you to easily install, manage, and work with multiple ruby environments.
Run the commands below to install RVM.
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
Installing a Specific Version
You may install a specific version with the command below:
rmv install [version]
List versions
You may list all versions installed on your machine with the command below:
rvm list
Using a Specific Version
To switch to a specific version, run the command below:
rvm use [version]
Set a Specific Version as default
To set a specific version as your default version, run the command below:
rvm --default use [version]