Writing things down so I can remember them later

WaltCo Tech

Archives Posts

Installing Ruby and Ruby on Rails in Ubuntu 7.10 Gutsy Gibbon

December 24th, 2007 by Walter Wilfinger

tl;dr version

sudo apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby
wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
tar xzvf rubygems-1.0.1.tgz
cd rubygems-1.0.1
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update --system
sudo gem install rails
sudo apt-get install build-essential ruby1.8-dev
sudo gem install mongrel
sudo apt-get install mysql-client mysql-admin mysql-query-browser libmysqlclient15-dev
sudo gem install mysql
sudo apt-get install sqlite3 swig libsqlite3-ruby libsqlite3-dev
sudo gem install sqlite3-ruby
echo "export RUBYOPT=rubygems" >> ~/.profile
rails path/to/your/app

Coming from Gentoo, I thought installing anything on Ubuntu would be a breeze. Especially something with so much Internet-hype as Ruby on Rails. Unfortunately, the process isn’t completely intuitive. After breaking my teeth on my first few Ubuntu installs (sudo apt-get install vlc…wow that worked?), I was expecting something along the following to work for Rails:

sudo apt-get install ruby rubyonrails

At which point Ubuntu’s magical installer gnomes would pop a working installation of Rails onto my laptop.

This, to my dismay, was not the case. From what I can gather, this is because you want to use RubyGems to manage your Ruby…gems. Ubuntu, on the other hand, really wants to use Aptitude to manage your Ruby gems. It wants to do this so much, in fact, that if you install RubyGems using Aptitude pretty much nothing will work. You can work around this by installing RubyGems to your home directory. I tried out that method, but found sudo gems update –system calls would try to update to /usr/lib.

For those playing at home, /usr/lib is not your home directory.

I would expect the open source super-nerds to figure this out. Leaving me, being a dumb end-user, only to do a single apt-get command, make a cup of tea, and then while still waiting for the water to boil Rails would finish installing. I would come back to an impatient laptop who is wondering why I thought the whole process would take so long.

The open-source nerds have instead decided — as far as I can tell by this nerd fight from October of this year — to just bitch about who is putting what in the wrong place. This leaves us longing for a Rails install; and that cup of tea now that we mentioned it. Hold on one minute…

Mmmm. Chai tea. Ok. We’re going to install Ruby using apt-get. Then we will install RubyGems from source, forgoing Aptitude altogether. Read the rest of this entry »