Installing Ruby 1.9.2 and Rails 3 on Mac OSX

For those struggling to get Ruby 1.9.2 and Rails 3 installed on Max OSX.

Installing the latest Ruby and Rails ended up quite an adventure. I wonder how many people just give up. Anyways the best way to install this was using Macports. Download and install Macports from http://www.macports.org/ .

If the installer complains that you have an older version of Apple’s XCode tool set then register at Apple’s site … download and install the latest XCode. This is a big download so be patient.

Next follow the instructions at http://www.ruby-forum.com/topic/178659 (posted by Conrad Taylor) to install the Ruby 1.9.2 and Rails 3.

A few quick pointers…

Step 2) type in “sudo port install …” for mysql and sqlite.

Step 5) type

sudo gem install kwatch-mysql-ruby –source=http://gems.github.com — –with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config

Step 7) type

rails new testapp

(testapp could be any name)

Before you get carried away create a rails application and ensure that you can access it in the browser. Go beyond the hello world page and add a model/controller. Execute the basic stubs using scaffolding and ensure db connectivity to the default sqlite3 db.