The newest version of Rails came out on August 29 so I decided to jump right in. Since Ruby 1.8.6 and earlier are no longer supported, we'll be using RVM in this article. RVM is a command line tool which allows us to easily install, manage and work with multiple ruby environments from interpreters to sets of gems.

Before we get started, we'll be using a fresh (ve) Server from (mt) Media Temple running Ubuntu 10.04 Lucid Lynx for the install. I should also note that we're not installing a full-featured application -- this is simply a tutorial on how to get the Rails 3.0 test application up and running with Nginx + Passenger.

Prerequisites: You'll need these to get through the entire install process for RVM, Nginx and Phusion Passenger (mod_rails).

Doing so ensures RVM is loaded as a function (versus as a binary), ensuring commands such as rvm use work as expected. Please note that you can confirm this worked correctly by opening a new shell and running:

type rvm | head -n1

If this was performed correctly, you should see:

rvm is a function

So if that looks good, we can continue installing Ruby:

rvm install 1.9.2

Now sit back and relax. This took about 8 minutes on my system. To make sure that the system uses this version, we can use RVM for this and install the rails and passenger gems:

rvm --default ruby-1.9.2
gem install rails passenger

Now comes the fun part of installing Nginx. This will grab the stable binary, bake in Phusion Passenger and compile it:

rvmsudo passenger-install-nginx-module

You will be presented with two options right from the start. Just choose Option 1 and let passenger download, compile and install Nginx for you. You'll also be prompted to choose a prefix directory. You can leave it as the default, /opt/nginx. When it completes, it should give you some Nginx configuration snippets for your rails apps. Save those as you'll need them later.

The spacing looks a little weird in that middle sed command for a purpose -- to keep the syntax of the nginx.conf file consistent. Now that we've restarted Nginx, we should see the 'Welcome aboard: You're riding Ruby on Rails!' image:

If you're interested in an all-in-one installation, I've put together the steps above into a simple bash script. Enjoy!