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
$ rvm help # Documentation Index

Examples of using RVM

RVM version

$ rvm -v

rvm 1.8.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

Use a particular Ruby.

$ rvm use 1.8.6

Equivalently (because of RVM's defaults):

$ rvm 1.8.6

List Ruby interpreters available for installation

$ rvm list known
  # MRI Rubies
  [ruby-]1.8.6[-p399]
  [ruby-]1.8.6-head
  [ruby-]1.8.7[-p330]
  [ruby-]1.8.7-head
  [ruby-]1.9.1-p243
  [ruby-]1.9.1[-p378]
  [ruby-]1.9.1-p429
  [ruby-]1.9.1-head
  [ruby-]1.9.2-preview1
  [ruby-]1.9.2-preview3
  [ruby-]1.9.2-rc1
  [ruby-]1.9.2-rc2
  [ruby-]1.9.2[-p136]
  [ruby-]1.9.2-head
  ruby-head

  # GoRuby
  goruby

  # JRuby
  jruby-1.2.0
  jruby-1.3.1
  jruby-1.4.0
  ...
  (plus many more; omitted for brevity)

List Ruby interpreters you've already installed

$ rvm list

   ruby-1.8.6-p383:  ruby 1.8.6 (2009-08-04 patchlevel 383) [i686-darwin10.0.0]
   ruby-1.9.1-head:  ruby 1.9.2dev (2009-10-30 trunk 25559) [x86_64-darwin10.0.0]
=> ruby-1.9.1-p243:  ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-darwin10]
   ruby-1.9.1-p25443:  ruby 1.9.1p281 (2009-08-09 revision 24476) [i386-darwin10.0.0]
   ruby-1.9.1-r25271:  ruby 1.9.1p281 (2009-08-09 revision 24476) [i386-darwin10.0.0]
   ruby-1.9.2-preview1:  ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-darwin10.0.0]
   ree-1.8.6-20090610:  ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-darwin10.0.0] Ruby Enterprise Edition 20090610
   ree-1.8.7-2009.10:  ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-darwin10.0.0], MBARI 0x6770, Ruby Enterprise Edition 2009.10
   ree-1.8.7-head:  ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]
   jruby-1.3.1:  jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]
   jruby-1.4.0:  jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]
   jruby-head:  jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2009-11-02 55366a1) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]
   macruby-head:  MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]
   macruby-nightly:  MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]
=> (default) ruby-1.9.1-p243:  ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-darwin10]
   system: ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]

Ruby information for the current shell

$ rvm info

rvm 0.0.49 (2009.09.24) [http://rvm.beginrescueend.com/]

ruby:
interpreter:  "ruby"
version:      "1.8.6"
date:         "2009-08-04"
platform:     "i686-darwin10.0.0"
patchlevel:   "2009-08-04 patchlevel 383"
full_version: "ruby 1.8.6 (2009-08-04 patchlevel 383) [i686-darwin10.0.0]"

homes:
gem:          "/Users/wayne/.rvm/gems/ruby/1.8.6"
ruby:         "/Users/wayne/.rvm/ruby-1.8.6-p383"

binaries:
ruby:         "/Users/wayne/.rvm/ruby-1.8.6-p383/bin/ruby"
irb:          "/Users/wayne/.rvm/ruby-1.8.6-p383/bin/irb"
gem:          "/Users/wayne/.rvm/ruby-1.8.6-p383/bin/gem"
rake:         "/Users/wayne/.rvm/ruby-1.8.6-p383/bin/rake"

environment:
GEM_HOME:     "/Users/wayne/.rvm/gems/ruby/1.8.6"
MY_RUBY_HOME: "/Users/wayne/.rvm/ruby-1.8.6-p383"
IRBRC:        "/Users/wayne/.rvm/ruby-1.8.6-p383/.irbrc"

Install JRuby (default version is 1.3.1), but do not use it right now.

$  rvm install jruby

Use Ruby 1.9.1

$  rvm use 1.9.1

Equivalent to "rvm use 1.9.1", due to defaults

$  rvm 1.9.1

Use Ruby 1.8.6

$  rvm 1.8.6

Switch to gems directory for current ruby

$ rvm gemdir

/Users/wayne/.gem/ruby/1.9.1

Switch to the system gems directory

$ rvm gemdir system

/Library/Ruby/Gems/1.8

Switch to the system user gems directory

$ rvm gemdir system user

/Users/wayne/.gem/ruby/1.8

Switch to gems directory for ruby jruby (1.3.1)

$ rvm gemdir jruby

/Users/wayne/.gem/jruby/1.8

Use the user set default ruby

$  rvm default

Use the system ruby (as if no rvm)

$  rvm system

Reset to pre-RVM state.

$  rvm reset

Uninstall RVM installed 1.8.7 version

$  rvm uninstall 1.8.7

Install gems from system gem dir (osx: /Library/Ruby/Gems/1.8) using current ruby

$  rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system
RVM Documentation Index