Update on Rails on OS X Leopard

Posted by Ric Tue, 17 Jun 2008 13:44:00 GMT

A few months ago I posted an article on how to get rails going on OS X Leopard, in which I advocated using Macports.

MacPorts and Ruby 1.8.7

In order to solve a strange problem with my MacBook Pro, I recently re-installed Leopard from scratch. (Apple said that they had fixed the problem in 10.5.3, but sometimes the problem lingered if you had been running on a non-updated version for a while. So far the problem hasn’t reoccurred, but I’m going to withhold judgment until I’ve run trouble-free for a few weeks – watch this space!).

Anyhow, I followed my own instructions in order to get my development environment back up and running again. However, Macports now installs ruby 1.8.7 by default, and it seems there is a problem with using this version of ruby with rails. When I tried to run my application, I got an error like this:

wrong number of arguments (2 for 1)
    /opt/local/lib/ruby/1.8/cgi/session.rb:267:in `respond_to?'
    /opt/local/lib/ruby/1.8/cgi/session.rb:267:in `initialize_without_cgi_reader' 
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_ext/session.rb:39:in `initialize'
    ...

I couldn’t figure out how to get Macports to install a previous version of ruby. Note that this doesn’t work:

  sudo port install ruby @1.8.6

If anyone knows how to do this, please leave a comment! Maybe I’m being stupid.

UPDATE 19th June 2008: You might want to check out this post by Sho Fukamachi for tips on how to fix Ruby 1.8.7

UPDATE 1 July 2008: Check out my latest blog post for more info on reverting to 1.8.6

Hivelogic

At least with Macports, I could just delete the /opt/local folder and start again. So, I reverted back to using Dan Benjamin’s instructions on HiveLogic so that I could install ruby 1.8.6. Dan’s procedure works a treat, except that I recommend defining the path in ~./bash_profile instead of ~/.bash_login. (See the first comment on his article, and this).

Netbeans 6.1

Since I wrote the original blog article, Netbeans 6.1 has been released. Most of the settings are the same as for version 6.0, but there are few new bits:

For the fast step-through debugging, you need to make sure you have the right versions of ruby-debug installed, i.e. ruby-debug-base 0.10.0 and ruby-debug-ide 0.1.10

You also need to make sure your ruby platform is set up under Tools->Ruby Platforms, and tell Netbeans to use this platform by going to Build->Set Main Project Configuration->Customize.

I’ve noticed a couple of bugs in Netbeans 6.1, such as not refreshing the svn properties every time (work around this by choosing show changes from the Subversion menu before committing), and forgetting some editing preferences. Hopefully these will be fixed soon.

Trackbacks

Use the following link to trackback from your own site:
http://www.ricroberts.com/trackbacks?article_id=update-on-installing-rails-on-leopard&day=17&month=06&year=2008

  1. Update on Rails on OS X Leopard - Is My Macbook Pro 32 Or 64 Bits ♦ Apple MacBook and MacBook Pro News Is My Macbook Pro 32 Or 64 Bits ♦ Apple MacBook and MacBook Pro News
    [...] an interesting post was made today on this site [...]...
Comments

Leave a comment

  1. Avatar
    Mike Pence about 4 hours later:

    It is a hell of an IDE, NetBeans 6.1. The guys I pair program with, once they see it, leave TextMate behind.

Comments