Rails / Ubuntu Edgy Quickstart
If you’ve just installed a fresh copy of Ubuntu 6.10 (Edgy Eft), the following sequence of commands will give you everything you need to run Rails with MySQL or Postgres and Mongrel. (See here for the same instructions for the latest version, Feisty Fawn.) This should be run as root (”sudo su -” will get you a root shell).
First, core packages through apt-get:
echo "deb http://us.archive.ubuntu.com/ubuntu/ edgy universe" >> /etc/apt/sources.list
echo "deb http://us.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe multiverse" >> /etc/apt/sources.list
apt-get update
apt-get install postgresql-8.1 mysql-server ruby ruby1.8-dev irb rdoc libopenssl-ruby1.8 libpgsql-ruby libc6-dev
Now RubyGems:
wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz
tar xzvf rubygems-0.9.2.tgz
cd rubygems-0.9.2
sudo ruby setup.rb
sudo gem update
sudo gem install -y rails mongrel
If it prompts you for which version of Mongrel or whatever to install, the first one on the list (type “1″ and press enter) is almost always right, unless it reads “win32″, in which case pick the first one that says “ruby”. (This silliness is definitely a major weak point of the gem package manager.)
Now, enable mod_rewrite and mod_proxy in your Apache modules (the latter is only necessary if you plan to proxy mongrel, but might as well have it):
cd /etc/apache2/mods-enabled/
ln -s ../mods-available/rewrite.load
ln -s ../mods-available/proxy.load
/etc/init.d/apache2 restart
For bonus points, you might want to install a few other useful developer tools:
apt-get install php5 php5-cli php5-pgsql php5-mysql vim-gtk vim-ruby subversion openssh-server
April 16th, 2007 at 11:11 am
There is a typo in line 2:
`>> /dev/apt/sources.list` should be `>> /etc/apt/sources.list`