How to Instal Ruby On Rails on Ubuntu

We have to install "RVM", "Ruby", "Gem" and "Rails" one by one.

0) Update your packages

sudo apt-get update

1) Install RVM (Ruby Version Manager)

sudo apt-get install curl
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm

2) Be sure "rvm is a function"

type rvm | head -n 1

3) Find requirements and Install all of them

rvm requirements

sudo /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

4) Install Ruby

rvm install 2.0.0-p247

5) Use final version

rvm use 2.0.0-p247 --default

6) Install RubyGems

rvm rubygems current

7) Install Rails

gem install rails

And you have Ruby On Rails on you Ubuntu