Wednesday, November 21, 2007

Using Xcode for Ruby/Rails Development

Now that I have my iMac pretty much all set up, I asked myself what I would now use as a development environment for Ruby on Rails.
On my old machine, I settled on vim with a few plug-ins. Since my new machine has got CPU cycles to spare, I have a few options:
  1. Eclipse
  2. Komodo
  3. vim + plugins
  4. Xcode
The last option, using Xcode, turned out to be surprisingly pleasant for me. Since the new version of the IDE supports Cocoa-Ruby programming, it means the text editor understands Ruby as a language. So syntax highlighting, dropdown for jumping between methods of a class/module, and even the folding indicator (which is visually awesome) all work. Integration with subversion is another bonus.

I did find one bug with the folding indicator, which I've filed with Apple. For example, let's say you have a class (database migration) as follows:
class MigrationTest < ActiveRecord::Migration
def self.up
def self.down
If you open up the file in Xcode's editor, and pay attention to the folding indicator, you will see that it thinks the class ended when the method self.up ended. Basically, it is confused.

A workaround would be to change the word self to MigrationTest.

Other than that, I find Xcode to be sufficient for my Rails development needs, for now.


stíobhart said...

if you think xcode is good, you should try textmate. it's the rolls royce of text editors for OSX.

Joe said...

Textmate is the best editor for small to mid-sized rails apps.

I've been working on some large complex applications lately and find the lack of refactoring tools to be problematic. I find myself needing more horsepower than a text editor gives me.

I've been looking for a full fledged IDE that will shine working with Rails.

I looked into Intellij but it was large, slow, and sadly most of the functionality was purpose built for java apps. When working with Ruby apps the vast majority of the strength of Intellij is disabled.

Eclipse is well... Eclipse, ditto Aptana.

Right now I'm looking at trying using Visual Studio using Sapphire Steel (run through Fusion) or Xcode.

tucano said...

TextMate is not free, XCode is no free...

Use vim, vim is forever!

PM said...

try netbeans for ruby.... it rocks, just like xcode.

Jay said...

Try Coda, it's really great.

Michael said...

Tucano, Xcode is free...

Richard Hurt said...

I seconds the NetBeans comment. I tend to code on both OS X and Ubuntu and wanted an IDE that worked on both systems. I'd tried Eclipse and NetBeans in the past but was always unsatisfied with their speed. However, it seems that Sun has finally gotten something right with the latest NetBeans 6.7 release. Its fast and feature complete. The only thing I am really missing is Git integration. That and some annoying intellihelp that I have to find how to turn off... :)


PT said...

Netbeans, Sun's finally got it right for Rails, is a champ. Be wary of the 6.8 beta edition though, it's still settling down.

Ben said...

Textmate is getting old, Tryout Sublime Text 2 (it's free while in beta)

Ben said...

Textmate is getting old, Tryout Sublime Text 2 (it's free while in beta)