Ruby

RVM

What is RVM?

RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.


Installation

Ubuntu Server

$ gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
$ \curl -sSL https://get.rvm.io | bash -s stable

For installing RVM with default Ruby and Rails in one command, run:

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

Using RVM

Listing Installed Ruby Versions

To view the currently installed Ruby versions, use the following command:

rvm list

Installing Ruby

To install a specific Ruby version, execute:

rvm install 2.7.5

If you need to reinstall a specific version, use:

rvm reinstall ruby-2.7.5

Handling OpenSSL Dependencies

In some cases, Ruby installation may require OpenSSL support. To install OpenSSL and configure Ruby with it, run:

rvm pkg install openssl
rvm install 2.7.5 --with-openssl-dir=$rvm_path/usr

Using a Specific Ruby Version

To set a specific Ruby version as the default, use:

rvm use 2.7.5 --default

Removing a Ruby Version

To remove a specific Ruby version from your system, execute:

rvm remove 2.7.5
Previous
Gem