Installing Ruby on Rails on Ubuntu

I decided to install Ubuntu 13.10 on my current desktop to compare developing on Ubuntu versus OS X. As I needed to install Rails as well I decided to document the steps for future reference as well.

Reference: http://gorails.com/setup/ubuntu/13.10

Installing Ruby

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev

Installing RVM

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.0
rvm use 2.1.0 --default
ruby -v

Installing NodeJS

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Installing Rails

gem install rails

Setting up MySQL

sudo apt-get install mysql-server mysql-client libmysqlclient-dev

Setting up 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

Works for Ubuntu 13.10 (Saucy Salamander)

For other related Rails Posts – here’s my cheatsheet for all things Rails