set-up Ruby on Rails & MySQL on Mac OS X Leopard
OS X Leopard [10.5] already comes with rails installed and working (unlike the broken version that was shipped in OS X Tiger [10.4]). But it doesn't have MySQL installed by default, so here's a quick way to get up to the latest versions.
First you need to get your install disc and install Xcode from it, browse your Leopard install disc and navigate to Optional Installs > Xcode Tools and from there launch XcodeTools.mpkg. If you dont have the install disc handy you can download Xcode from the apple website.
Next start up a terminal session (Application > Utilities > Terminal) and issue the following command to bring rails to the latest version:
sudo gem update --include-dependencies
Now grab a copy of MySQL and install it from
http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg don't forget to setup MySQL to start at boot time, if you dont want to have to start it manually each time, either from the command line or the System preference pane.
Now to get rails talking with mysql, again from the terminal issue this command, which sorts out the mysql C bindings
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Yep that last command was a bit more complicated than the normal "gem install xxx" but that's because we needed to tell the build process the architecture and configuration file location explicitly otherwise it fails.
At this point your all sorted, and ready to rock, Happy coding.