How To – Installing Ruby on Rails on Ubuntu Lucid Lynx 10.04 Server

Install required packages

sudo apt-get install build-essential git-core zlib1g-dev libssl-dev libreadline5-dev

The required packages for installing Ruby Enterprise, and Git thrown in for good measure.

Install Ruby Enterprise

Download ruby-enterprise-1.8.7-2010.02.tar.gz & Install

wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
tar xzvf ruby-enterprise-1.8.7-2010.02.tar.gz
sudo ./ruby-enterprise-1.8.7-2010.02/installer

May take a long time to get past the “Generating RI…” bit
Also, ignore the  “The following gems could not be installed”

Should get the following screen after a lot of waiting..

Install ‘Target directory’ as default (press enter)

Make ruby upgrades easier later

sudo ln -fs /opt/ruby-enterprise-1.8.7-2010.02 /opt/ruby-enterprise
sudo ln -fs /opt/ruby-enterprise/bin/gem /usr/bin/gem
sudo ln -fs /opt/ruby-enterprise/bin/irb /usr/bin/irb
sudo ln -fs /opt/ruby-enterprise/bin/rake /usr/bin/rake
sudo ln -fs /opt/ruby-enterprise/bin/rails /usr/bin/rails
sudo ln -fs /opt/ruby-enterprise/bin/ruby /usr/bin/ruby

Install Passenger & Apache

sudo apt-get install apache2-mpm-prefork  apache2-prefork-dev libapr1-dev libaprutil1-dev
sudo /opt/ruby-enterprise-1.8.7-2010.02/bin/passenger-install-apache2-module

Update Apache configuration file

sudo nano /etc/apache/
Ctrl + W -> Ctrl + V #goto bottom of document in nano
#Paste the below lines
###### Passenger Configuration
LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /opt/ruby-enterprise/bin/ruby
######
Ctrl + X #exit
Y #confirm saving

Restart Apache

sudo /etc/init.d/apache restart

You can now delete the files we downloaded and extracted earlier.

Install basic gems

sudo gem install paperclip capistrano

Install a Database

Now deploy with Capistrano!

Posted on September 13, 2010 at 5:55 pm by Jordan Carter · Permalink
In: How To · Tagged with: , , , , , ,

One Response

  1. […] Remove the ruby install (hopefully just rvm remove 1.9.2) Then install zlib1g-dev libssl-dev libreadline5-dev as detailed at the start of this post on installing ruby on rails on Ubuntu […]

Leave a Reply