Basic steps to setup RVM

The next time you decide to install ruby for multiple applications, rvm is the best option to handle various versions easily. Just follow the below steps which i have compiled to make things clear and easy:


Install rvm,Ruby 1.9.2 and rails 3.0.0


Execute the commands as specified:

$ which ruby
$
$ sudo apt-get install curl git-core ruby
$ bash < <( curl https://rvm.beginrescueend.com/releases/rvm-install-head )
$ vim $HOME/.bashrc

You need to replace the line that says

       [ -z "$PS1" ] && return

with

       if [[ -n "$PS1" ]]; then

Now add this to the last line of the file

       if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi
       fi

Reload the environment by running

$ source ~/.bash_profile or restart the terminal

Now enter,
$ rvm notes

This lists the packages to be installed for various ruby flavours, install the packages under the MRI & ree section as we require 1.9.2.

$ sudo aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev git-core subversion autoconf

$ rvm list known
$ rvm package install readline  or use rvm pkg install readline
$ rvm install 1.9.2-head -C --with-readline-dir=$HOME/.rvm/usr
$ rvm --default 1.9.2-head
$ ruby -v
$ gem install rails

So, the installation is complete and you can start with your first project. I would suggest you to refer this link and install the basic libraries which are required by various gems when you use then in your application.

Installing on Ubuntu

These libraries needs to be installed with sudo permissions and are installed once. There are issues with bundle install which gives errors like building with native extensions and then displays the list of errors. To fix those errors just checkout the installation fails for which gem and install the libraries suggested or search the appropriate libraries.

Bijendra Singh

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard.

0 comments: