Online Help
You can find the RVM team:
mpapis, rys, ddd on IRC in
#rvm on irc.freenode.net
If we do not respond right away, leave a message and a contact to you like email or twitter.
Sponsors
Small Sponsors
$ rvm help # Documentation Index

Installing RVM

Quick (guided) Install

Unless doing guided install you should read all sub-sections under the RVM Section.

Install RVM (development version):
\curl -sSL https://get.rvm.io | bash
Without autolibs
\curl -sSL https://get.rvm.io | bash -s -- --autolibs=read-fail
Install RVM stable with ruby:
\curl -sSL https://get.rvm.io | bash -s stable --ruby
Additionally with rails (poor man's railsinstaller ):
\curl -sSL https://get.rvm.io | bash -s stable --rails
Or with jruby, rails and puma:
\curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby --gems=rails,puma
To install without rubygems-bundler and rvm gems (and also remove those gems from both global.gems and default.gems):
\curl -sSL https://get.rvm.io | bash -s stable --without-gems="rvm rubygems-bundler"
To install with hirb gem (and also add it to global.gems):
\curl -sSL https://get.rvm.io | bash -s stable --with-gems="hirb"
To install with rails and haml gems (and also add them to default.gems):
\curl -sSL https://get.rvm.io | bash -s stable --with-default-gems="rails haml"
For a progress bar when downloading RVM / Rubies:
echo progress-bar >> ~/.curlrc

Point to be noted is, there is a backslash before curl. This prevents misbehaving if you have aliased it with configuration in your ~/.curlrc file.

If you're an existing RVM user and you don't want RVM to attempt to setup your shell to load RVM, you can opt out of this at install time by exporting rvm_ignore_dotfiles=yes, or opt out permanently by setting this in your rvmrc.

You can also:


Installation explained

There are three different ways to install and configure RVM.

  1. Single-User installations (recommended) - For an isolated install within a user's $HOME, not for root.
  2. Multi-User installations - For server administrators - For an installation usable by all users on the system - Please note that Single-User supercedes Multi-User. This also used to be called the System-Wide Install. Using this type of installation without knowledge how umask works is a big security risk.
  3. Mixed mode installations - For an installation usable by all users on the system - with isolated rubies/gemsets within a user's $HOME. Installation instructions are exactly the same as for Multi-User installations, the difference is in users environment.

get.rvm.io is a redirect to https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer You could also use full path for the installer:

\curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable

Installation

I recommend you read the installation script yourself. This will give you a chance to understand what it is doing before installing, and allow you to feel more comfortable running it if you do so.

1. Download and run the RVM installation script

Installing the stable release version:

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

To get the latest development state:

user$ \curl -sSL https://get.rvm.io | bash

Instruct RVM to not change the shell initializations files '*rc' / '*profile':

user$ \curl -sSL https://get.rvm.io | bash -s -- --ignore-dotfiles
Please note that from this point it is user responsibility to add sourcing rvm to appropriate files.

For a Multi-User install you would execute the following:

user$ \curl -sSL https://get.rvm.io | sudo bash -s stable
     Note: The Multi-User install instructions must be prefixed with the 'sudo' command. However, once the install is complete, and the instructions to add users to the rvm group is followed, the use of either sudo or rvmsudo is no longer required. The 'sudo' command is only to temporarily elevate privileges so the installer can complete it's work. If you need to use 'sudo' or 'rvmsudo' after the install is complete, some part of the install directions were not properly followed. This usually is because people execute the install as root, rather than executing the installation instructions from a non-privileged user account.

Installing a specific version:

user$ \curl -sSL https://get.rvm.io | bash -s -- --version latest
user$ \curl -sSL https://get.rvm.io | bash -s -- --branch [owner/][repo]
Prefix the 'bash' portion with 'sudo', of course, if you wish to apply this to a Multi_user Install. Please feel free to check out our upgrading docs for more details on branch format.

Debugging installation process:

user$ \curl -sSL https://get.rvm.io | bash -s -- --trace

If the rvm install script complains about certificates you need to follow the displayed instructions.

Single-User Install Location: ~/.rvm/

If the install script is run as a standard, non-root user, RVM will install into the current users's home directory.

Modification of user configuration files (*rc / *profile) - RVM by default will modify user startup files, although it is not recommended you can disable automated process and do this manually (RVM version 1.18 / head):

user$ \curl -sSL https://get.rvm.io | bash -s -- --ignore-dotfiles
user$ echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile

Multi-User Install Location: /usr/local/rvm

If the install script is run prefixed with sudo, RVM will automatically install into /usr/local/rvm Please see the troubleshooting page for an important note regarding Multi-User Installs.

Please see the FAQ page for an important note regarding root only installs

External tutorials

Note that that any outside tutorials are NOT supported whether they work or not. Tutorials are great, however we have spent massive amounts of man hours debugging the installation process. Please use the install process(es) from this site only, as this is the only supported installation types and methods.

To update an existing RVM installation

It is safe to simply re-run the installation script again, or you can follow the upgrading docs.

2. Load RVM into your shell sessions as a function

Single-User:

The rvm function will be automatically configured for every user on the system if you install as single user. Read the output of installer to check which files were modified.

Multi-User:

The rvm function will be automatically configured for every user on the system if you install with sudo. This is accomplished by loading /etc/profile.d/rvm.sh on login. Most Linux distributions default to parsing /etc/profile which contains the logic to load all files residing in the /etc/profile.d/ directory. Once you have added the users you want to be able to use RVM to the rvm grou p, those users MUST log out and back in to gain rvm group membership because group memberships are only evaluated by the operating system at initial login time. Zsh not always sources /etc/profile so you might need to add this in /etc/**/zprofile:

source /etc/profile

Mixed mode (user gemsets):

Gemsets created by these users will be hosted in their HOME directory. It's not possible to use global gemsets from system without using tricks like manually linking directories and they should not be used in mixed-mode. Please bear in mind that 'system' in this context does not refer to your distribution's ruby packages, but to the RVM Multi-User installation.

You have two possibilities to manage RVM. The first one is to add managers to the rvm group. The second one is to use separate managers with rvmsudo and privilege escalation. Note that it is not safe to use rvmsudo from mixed mode user. Both can be mixed without any side-effect. It is however very important to not enable mixed-mode gemsets or rubies for the managers. RVM is using a custom umask (umask u=rwx,g=rwx,o=rx) when installing gemsets, rubies, updating itself, etc. This should not impact your system. But if you prefer to avoind RVM messing around with your umask, you can comment the umask line in /etc/rvmrc.

This mode should also works with passenger, please follow passenger instructions.

3. Reload shell configuration & test

Close out your current shell or terminal session and open a new one (preferred). You may load RVM with the following command:

user$ source ~/.rvm/scripts/rvm

If installation and configuration were successful, RVM should now load whenever you open a new shell. This can be tested by executing the following command which should output 'rvm is a function' as shown below.

user$ type rvm | head -n 1
rvm is a function

NOTE: Before reporting problems check 'rvm notes' as it might contain important information.

Congratulations! You have successfully installed RVM.

Try out your new RVM installation

Below are some examples of how to install and use a Ruby under RVM.

Display a list of all "known" rubies. NOTE: RVM can install many more Rubies not listed.

user$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p374]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3[-p545]
[ruby-]2.0.0-p353
[ruby-]2.0.0[-p451]
[ruby-]2.1[.1]
[ruby-]2.1-head
ruby-head
...

Install a version of Ruby (eg 2.1.1):

user$ rvm install 2.1
Checking requirements for opensuse.
Requirements installation successful.
Installing Ruby from source to: /home/mpapis/.rvm/rubies/ruby-2.1.1, this may take a while depending on your cpu(s)...
...
Install of ruby-2.1.1 - #complete
Using /home/mpapis/.rvm/gems/ruby-2.1.1

Use the newly installed Ruby:

user$ rvm use 2.1
Using /home/mpapis/.rvm/gems/ruby-2.1.1

Check this worked correctly:

user$ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]

user$ which ruby
/home/mpapis/.rvm/rubies/ruby-2.1.1/bin/ruby

Optionally, you can set a version of Ruby to use as the default for new shells. Note that this overrides the 'system' ruby:

user$ rvm use 2.1 --default

Enjoy using RVM!

Where to now?

If you are new to RVM I recommend that you read the basics page. At the end of the basics page there are further links for getting started.

Troubleshooting Your Install

Example RVM bootstrap script

The following script will boostrap git + RVM, assuming that you have curl and sudo installed. The last line of the script will also install several commonly used Rubies for you.

#!/usr/bin/env bash

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

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

# Install some Rubies
source "$HOME/.rvm/scripts/rvm"
command rvm install 1.9.2,rbx,jruby

For a Multi-User install you would use:

#!/usr/bin/env bash

# Install git
\curl -sSL https://get-git.rvm.io | sudo bash

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

# Install some Rubies
source "/usr/local/rvm/scripts/rvm"
command rvm install 1.9.2,rbx,jruby
RVM Documentation Index