rvm
is a version manager for Ruby.
Run the following command to install rvm on macOS:
\curl -sSL https://get.rvm.io | bash -s -- --version latest
Restart your shell. Confirm rvm is working:
rvm -v
To list installable Ruby versions:
rvm list known
Install a specific version of Ruby:
rvm install 3.0.4
Use a specific version of Ruby:
rvm use 3.0.4
Uninstall a specific version of Ruby:
rvm uninstall 3.0.4
If you have problems installing a Ruby version due to missing OpenSSL packages, run the following to resolve to OpenSSL in /usr/local/opt:
rvm install 3.2.0 --with-openssl --with-openssl-lib=/usr/local/opt/[email protected]/lib --with-openssl-include=/usr/local/opt/[email protected]/include
You can uninstall rvm with the following command:
rvm implode