Category Archives: natty

Installing Rails 3 on Ubuntu 11.04

One of the more challenging problems with the opensource world (and joys in my opinion) is the rate of change of the software and systems. Unfortunately it means that every year I seem to be having to learn new ways of installing the latest tools. Every 6 months when I install the latest Ubuntu and Rails, something needs hand holding. Here is my attempt to get Rails running on Ubuntu 11.04.

Firstly, credit goes to yasi8h from theKindOfMe blog – see the original post here http://thekindofme.wordpress.com/2010/10/24/rails-3-on-ubuntu-10-10-with-rvm-passenger-and-nginx/

Below is a variation of the process outlined in the blog post, however I have changed things to make it work for a fresh Ubuntu 11.04 install.

Run the following in sudo/root

apt-get install curl git-core build-essential bison openssl libreadline5 libreadline5-dev zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev mysql-client mysql-server autoconf

curl -L http://rvm.beginrescueend.com/releases/rvm-install-head > rvm-install-head
bash rvm-install-head


Read and follow the instructions given as shell output after  rvm-install-head to edit your .bashrc. You will need to remove the return statement and wrap the whole code block in if’s and append the command to load the rvm into the shell environment. 


OR


http://beginrescueend.com/rvm/install/ suggests running:
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile

rvm install 1.9.2
rvm use 1.9.2 –default
rvm 1.9.2 –passenger
rvm 1.9.2
gem install passenger
apt-get install libcurl4-openssl-dev
rvmsudo passenger-install-nginx-module



gem install rails


rm rvm-install-head