How to install Ruby On Rails in ubuntu

Ruby is awesome , for getting up running with latest ruby development environment is not that easy, well RVM ( ruby version manager ) comes handy for getting latest ruby . rvm is awesome but when you looks first time at rvm.io you will get confused  , what to use , and how to ,  for  your developement environment . if you want to see alternative you can see rbenv . which is also great and lightweight than rvm .  Simple ruby and ruby on rails gem on ubuntu .  open terminal and use ( either type or copy paste ) follow  steps  

First Install required packages 

sudo apt-get install curl git software-properties-common 

first

sudo apt-get install gawk g++ gcc make libc6-dev libreadline6-dev 
zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf 
libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev

Next Install rvm

Open terminal

curl -L https://get.rvm.io | bash -s stable

in case on GPG bad signature or error paste this

command curl -sSL https://rvm.io/mpapis.asc | gpg --import -

install rvm
It will take few seconds to finish installing then restart your shell to get rvm functionality. after that 

source ~/.rvm/scripts/rvm
type rvm | head -n 1 
rvm is a function  

RVM working

Now lets install ruby

rvm install ruby-2.0.0-p247 

install ruby

ruby installed

using installed ruby

Now ruby is installed . now lets install gems

create gemset and set rvm to use that Gemset as default

rvm gemset create r4
rvm use 2.0.0-p247@r4 --default

gemset

Now lets start installing gems

gem install bundler
gem install rails

wait until it finish installing and after that you can see all the installed gems by using ‘$ gem list ‘