Setting up RubyOnRails environment on Ubuntu 14.04

This tutorial is about setting up environment for RubyOnRails on Ubuntu 14.04.

First of all, update & upgrade your system:

sudo apt-get update

^
sudo apt-get upgrade
^

Install git and curl:

sudo apt-get install curl

^
sudo apt-get install git-core
^

Configure git:

git config --global user.name "Your Name"

^
git config --global user.email email@example.com
^

Install RVM:

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

^
source ~/.rvm/scripts/rvm
^
Test RVM installation correctness:

type rv...

Ubuntu 12.04 phantomjs installation

Visit PhantomJS site, go to download page and copy link address for Linux, in our case this is https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2

Then go to console and run following commands:

sudo apt-get install libfontconfig libfontconfig-dev libfreetype6-dev

^
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2
^
sudo mv phantomjs-1.9.2-linux-x86_64.tar.bz2 /opt
^
cd /opt
^
tar -xvf phantomjs-1.9.2-linux-x86_64.tar.bz2
^
ln -s /opt/phantomjs-1.9.2-linux-x8...

Ubuntu postgresql 9.3 installation for RoR

Add repository and install Postgresql:

^
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
^
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
^
sudo apt-get update
^
sudo apt-get install postgresql-common
^
sudo apt-get install postgresql-9.3 libpq-dev
^

Then make yourself a Postgresql superuser:

sudo su postgres

^
createuser your_system_login
^
psql
^
ALTER ROLE your_system_login WITH SUPERUS...