Last day I was trying to perform Ruby installation on my distro. Problem was that I already have latest version Ruby installation and wish to keep it and at the same time install an older version. After doing some research on this I came across RVM. Now RVM is an incredible work which saved my day. Before get into it multiple ruby installation we can what is Ruby and RVM.
What is Ruby?
So, What is Ruby? Ruby is a scripting language which can be run on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. Ruby is used in typical scripting language applications such as text processing and “glue” or middleware programs. It’s suitable for small, ad-hoc scripting tasks that, in the past, may have been solved with Perl.
What is RVM?
Now back to RVM. RVM or Ruby Version Manager is a platform designed to manage multiple installations of Ruby on the same device. The different versions can then be switched between to enable a developer to work on several projects with different version requirements.
Note: curl needs to be installed before proceeding.
Install Ruby Version
Before starting we will need to download the gpg-keys.
Run following from the terminal.
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
Now you can install Ruby by following command
\curl -sSL https://get.rvm.io | bash -s stable --ruby=x.x
x.x refers to the version you need to install
To view the installed Rub version, run following command.
rvm -v
List Ruby Versions
To list installed ruby versions, you can run following command.
rvm list
Switch Version
rvm --default use <version>
Never thought multiple Ruby installation could be this much easy. ð