Ruby on Rails development on Mac OS X

Getting RoR installed is pretty easy with Locomotive, an entirely self-contained RoR environment for Mac OS X (there is a Windows equivalent called Instant Rails). This means no installing all the pieces, and no messing up of anything in Mac OS X (which includes Ruby these days). You just drag the application into your Applications folder and you are good to go. However, it also means that any other tool or application that needs to call Ruby has to be configured to use the version installed inside Locomotive (which is really a bundle that includes the application and all the RoR components).

The hip text editor for RoR on the Mac is TextMate. However, it’s a commercial application and has no API for Hackystat hooks, so I’m avoiding it for now.

The best alternative (for Eclipse users) appears to be RadRails. It’s available as a standalone editor (a customized version of Eclipse) or as an Eclipse plugin. Annoyingly, RadRails is currently in transition as Aptana (a company that makes an open source JavaScript/AJAX editor plugin for eclipse) takes over the development from the original developers. This means the documentation and website is a bit of a mess right now.

Pieced together from various web pages, here is how to get up and running with RoR on Mac OS X (assuming you have Eclipse 3.2.X already installed):

  1. Download Locomotive and drag the Locomotive icon into your Applications folder.
  2. Install RDT and RadRails Eclipse plugins. Aptana has the links in their RadRails docs.
  3. Configure RadRails to use RoR embedded in Locomotive. Due to the RadRails documentation transition right now the wiki with the instructions is only available from Google’s cache, but here it is from some blog. Note that Preferences will be under the Eclipse menu (not RadRails, the customized Eclipse version), and that the exact paths will be different based on what version of Locomotive you have (the release date is part of the path, ugh) and whether you are on an Intel-based Mac (select “i386” path) or a PowerMac (select “powerpc” path).

After following my instructions I was still getting weird errors in RadRails when trying to create a HelloWorld project. I think the key is to do the RadRails configuration before creating any projects. Remember that Eclipse configuration follows the workspace, so if you create a new Workspace for RoR work then make sure you do that before you configure RadRails to use the Locomotive paths.

Advertisements

2 thoughts on “Ruby on Rails development on Mac OS X

  1. Simon

    Locomotive installs an older version of Ruby 1.8.1, which is older than the 1.8.7 needed to run Rails 3.

    I used PortAuthority to install the more recent Ruby version. Download it from sourceforge.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s