Getting your first ruby on rails stack up and running can be a bit of a chore, here's a quick guide on how to do it on a linux box but the instructions should be equally good for OS X users.

Installing Ruby

Now depending on your OS, you've got a few options on how to get ruby up and running. The easiest way is to use the built-in package management system. This will give you the latest known stable version of ruby for your environment, and hopefully reduce or remove any potential conflicts with other installed software. The downside is that quite often the packaged version are a few releases behind the currently advertised stable version just due to the time it takes for the linux distribution manages to bundle them up.

Installing Ruby from yum/apt-get

If you've got a package manager, just enter whichever of the following commands is the most appropriate:

sudo yum install ruby irb rdoc ruby-devel

sudo apt-get ruby irb rdoc ruby-devel

Installing Ruby from Source

If you've decided to take the from source option, then you'll need to do the following:


tar zxvf ruby-1.8.7-p72.tar.gz

cd ruby-1.8.7-p72



sudo make install

Installing ruby gems

Gem is the package system for ruby, and it's the easiest way to install most of your ruby dependencies (including rails). So grab it from sourceforge:


tar zxvf rubygems-1.3.0.tgz

cd rubygems-1.3.0

sudo ruby ./setup.rb

Installing Ruby on Rails

Now getting rails installed is a breeze, all you need to do is:

sudo gem install rails

You may need to install your native database driver bindings too, if so:

sudo gem install mysql

sudo gem install postgres