Leopard and Rails

After having gone through the pain of installing Ruby on Rails on my MacBook Pro running Tiger (OS X 10.4) I was pleased to see that Leopard (OS X 10.5) ships with Rails ‘pre-installed’ and ready to go.

So, after I upgraded my installation on Friday night I was perplexed when trying to run my Rails apps. Why was it broken?

In the end, it turns out there were several problems.

Firstly, I figured that since I had a ‘fresh’ Ruby and Rails that my gems were missing. A quick ‘gem install’ failed with messages about Ruby headers. A Google search told me that I needed to install XCode to get the Ruby headers. Really? OK, so I did that.

Second, it appears that the MySQL connector was broken and needed to be installed. Worse, it is a pretty cryptic command required:

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Third, I was getting the usual error when MySQL is not running and after some investigation it turned out the MySQL was an application that didn’t make the migration. A quick install, database creation and ‘rake migrate’ and I was back in business.

Certainly far from a pain free migration, plus I am glad that I didn’t have any critical data in MySQL🙂

Written by Mark Johnson

Mark Johnson is one of the Directors of Shine Solutions Group, a Technology Consultancy in Melbourne, Australia.

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