giovedì 28 ottobre 2010

Install Ruby Version Manager (RVM) on Ubuntu Lucid/Maverick

RVM is a command line tool which allows us to easily install, manage and work with multiple ruby environments from interpreters to sets of gems. In order to install RVM you need a few packages:
sudo apt-get install build-essential curl zlib1g-dev
libreadline5-dev libssl-dev libxml2-dev
Now you need to install a temporary version of ruby and rubygems. This version will be used to install the rvm gem.
sudo apt-get install ruby1.8 rubygems1.8
After the installation is completed you can install the rvm gem with the command:
sudo gem install rvm
To complete the installation now run:
/var/lib/gems/1.8/bin/rvm-install
As the last step you have to add the following line to the file .bashrc in your home. So edit it with your favourite editor or create it if it doesn't exist.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.
To verify the installation, type rvm -v and the output should be the following:
$ rvm -v
rvm 1.0.15 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
Now to install ruby inside rvm use the simple command:
$ rvm install 1.9.2
"1.9.2" is the version of the ruby interpreter that you want to install. RVM automatically downloads the sources from the internet, compiles and install them. To set 1.9.2 as the default version use the command:
rvm --default 1.9.2
Enjoy with ruby!

Nessun commento:

Posta un commento