Just do /bin/bash --login
to load it to bash shell.
Then run rvm list known to see what all ruby versions are available for download. You could see,
$ 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
After that just install the ruby version you need using rvm
command. E.g.,
rvm install ruby-2.1.1
After having installed multiple ruby versions, run command rvm list
to see what all ruby versions are installed,
$ rvm list
rvm rubies
ruby-1.8.7-p371 [ x86_64 ]
ruby-1.9.3-p429 [ x86_64 ]
ruby-2.0.0-p195 [ x86_64 ]
ruby-2.0.0-p247 [ x86_64 ]
ruby-2.1.0 [ x86_64 ]
ruby-2.1.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
Then using the command rvm use
to use a particular ruby version for a particular project (from inside the project directory only). E.g.,
rvm use ruby-2.1.1
If you want it as the default version (May be you are running most of the ruby projects in ruby-2.1.1 version only), just use the below command,
rvm use ruby-2.1.1 --default
After all that just see the rvm list
, you could see the versions currently in use and selected by default. Both can also be the same ruby version.
$ rvm list
rvm rubies
ruby-1.8.7-p371 [ x86_64 ]
ruby-1.9.3-p429 [ x86_64 ]
ruby-2.0.0-p195 [ x86_64 ]
ruby-2.0.0-p247 [ x86_64 ]
ruby-2.1.0 [ x86_64 ]
=* ruby-2.1.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
Then, just run ruby -v
, you can see the ruby version selected for the project as,
ruby 2.1.1
run the command rvm help
to know about more commands.
Hope it helps :)