Fork me on GitHub
Donation
Love RVM? A donation would help justify to my family why I spend so much time working on Open Source projects like RVM.
Recommend
If you like my work with RVM, please recommend me *with a comment as to why you recommend me* on Working With Rails – Thank You!
IRC
I am 'wayneeseguin' in #rvm on irc.freenode.net If I do not respond right away, leave a message and I'll respond or leave you a memo when I am around.
Sponsors

Blue Box Group, LLC Nuxos Group

∴ rvm help # Documentation Index

Installing RVM

There are three very different ways to use RVM.

If you wish to install rvm system wide, please read our system-wide installation guide which takes a slightly different approach to the method highlighted below.

Don't forget to set your default ruby after the installation so that your command line opens with ruby enabled.

Install not working? Please ensure you've read the troubleshooting notes at the bottom of this page. Namely, you need to ensure returns in your shell profiles are converted to ifs.

There are at least 3 ways to install RVM.

1. GitHub Repository (recommended)

To install / update from the github repository (recommended):

∴ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

What this script essentially does is the following, with some extra checks and tweaks:

mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./install

Note that if you are behind a firewall (slower, but it should work), change the git:// to http:// like this:

mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 http://github.com/wayneeseguin/rvm.git && cd rvm && ./install

2. Installing / updating the latest rvm from the latest source tarball

∴ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )

What this script essentially does is the following, with some extra checks and tweaks:

version=$(curl http://rvm.beginrescueend.com/releases/stable-version.txt);
mkdir -p ~/.rvm/src/ && cd ~/.rvm/src/ && curl -O http://rvm.beginrescueend.com/releases/rvm-${version}.tar.gz | tar zxf - && cd rvm-${version} && ./install

3. Installing from a gem (not recommended)

Although we suggest installing the rvm gem for the ruby api part of rvm, we discourage the use of it for actually installing rvm itself - this primarily being since rvm updates are typically done via:

∴ rvm update

Versus the gem alternative of:

∴ gem update rvm && rvm-install

Meaning the gem version and the rvm version may both differ greatly. Also, installing as a gem requires you use an existing ruby. For the few cases where you must use a gem, you can simply do "gem install rvm" followed by running the rvm-install binary:

∴ gem install rvm                 # Install the RVM gem
# Adjust the path below for whever your system gem bin directory is located
∴ ~/.gem/ruby/1.8/bin/rvm-install # Install RVM, adds hooks for bash & zsh

If rvm-install is not found at the path listed it is likely because your users gem home is not in your path. You can find out the path to use by running

∴ gem env gemdir

This will show something like /Users/wayne/.gem/ruby/1.8

Post Install

The first time you install RVM, you must put the following line into your profile at the very end, after all path loads etc:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

Doing so ensures rvm is loaded as a function (versus as a binary), ensuring commands such as rvm use work as expected. Please note that you can confirm this worked correctly by opening a new shell and running:

∴ type rvm | head -n1

If this was performed correctly, you should see:

rvm is a function

Next, you can manually load the new code into your current shell and start using RVM ! w00t!

∴ source ~/.rvm/scripts/rvm

Be sure to install any dependencies for your operating system by running:

∴ rvm notes

The following script will boostrap git + RVM assuming that you have curl & sudo installed. It will also install (last line) several common rubies.

#!/usr/bin/env bash

# Install git
mkdir -p $HOME/.rvm/src && cd $HOME/.rvm/src && version=1.7.1.1
curl -O http://kernel.org/pub/software/scm/git/git-$version.tar.gz; tar xzf git-$version.tar.gz
cd git-$version && ./configure --prefix=/usr/local && make && sudo make install

# Install RVM
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

# Install some rubies
source "$HOME/.rvm/scripts/rvm"
rvm install ree,1.9.2-head,jruby

Troubleshooting your Install

RVM Documentation Index