Masatoshi Nishiguchi

RVM memo

This is my memo on the Ruby Version Manager (RVM).

Installing RVM

# Install RVM
$ \curl -sSL https://get.rvm.io | bash

# Reload this shell and initialize rvm
$ exec bash -l

# Update rvm
$ rvm get master

# Install ruby
$ rvm install 2.3.1
# NOTE: If you get the warning below, you can safely ignore it and move on to step 3.
# * WARNING: You have '~/.profile' file, you might want to load it,
#   to do that add the following line to '/Users/adamzerner/.bash_profile':

# Configure your default version of ruby
$ rvm use 2.3.1 --default

Upgrading RVM

# Upgrade to the most stable version
$ rvm get stable

Frequently-used commands

Command line cheatsheet

$ gem install cheat  # Install
$ cheat rvm          # Usage

Switching versions of Ruby

rvm list known      # List all available versions of Ruby
rvm list            # List all locally installed versions
rvm install 2.3.1   # Install the desired version

rvm use 2.3.1 --default # Configure your default version
rvm use 2.3.1       # Configure your current version
rvm 2.3.1           # Configure your current version
rvm uninstall 2.3.1 # Uninstall the version ruby-2.3.1
rvm info            # Display information on your default version

Switching gemsets

rvm gemset list             # List  all locally available gemsets (associated with the currently active version of Ruby)
gem list                    # List all gems in the current gemset
rvm gemset create _project  # Create a new gemset named "_project"
rvm 2.3.1@_project          # For the version ruby-2.3.1, use the gemset "_project"
rvm gemset delete _project  # Delete the gemset "_project"

Help

If you ever get stuck with RVM, run the following:

Reference