Friday, 22 February 2013

RVM Installation on Ubuntu

Ruby Version Manager (RVM) makes it ridiculously easy to install and switch between multiple Ruby versions on OS X and Linux.

This tutorial  is only for Ubuntu

Set up Git
Download and install the latest version of Git with Synaptic.

I suggest you install git-core, git-gui, and git-doc.

sudo apt-get install git-core

Install RVM

You could go out and install Ruby from source yourself, but I recommend installing it instead using the Ruby Version Manager (RVM), for installing RVM first you have to install curl

sudo apt-get install curl

Then, install RVM following the instructions on the RVM website. Or follow our instructions.

bash < <(curl -sk

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc

source ~/.bashrc

Now you can see the rvm version by typing

rvm -v

Wooohoo ! RVM is installed.

Install Ruby

Before installing Ruby, first you have install the dependencies by typing the following command

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison subversion

Now you can use use rvm to download, compile, and install Ruby by the command.

rvm install 1.9.3

rvm use 1.9.3 -default

The first command (rvm install) triggers the download/compile/install process, and installs Ruby and its gems under ~/.rvm, safely away from everything else on your system. The second command (rvm use) sets the 1.9.3 version of Ruby as the active default.

You can verify 1.9.3 is available by typing

ruby -v

Install Rails

After setting up ruby, we have to install Rails framework by typing

gem install rails -v 3.2.6

After setting up ruby, we have to install Rails framework by typing

rails -v