Setting Up Ruby on Snow Leopard Server

I had the opportunity to configure a new Snow Leopard Server for a customer who is running a Ruby application. Despite Apple’s claim that Snow Leopard Server is ready “out of the box” it turns out it isn’t quite “all” ready. Below are the extra things I had to do. Special thanks to Ryan Wilcox (Wilcox Development) who found the pertinent Apple KnowledgeBase page.

  1. Visit http://support.apple.com/kb/TA25017 (MySQL header files available for download)
  2. Follow the link to the current header files
  3. Download the MySQL binary. Here the instructions on Apple’s page (for Leopard) fall apart. Since Snow Leopard automatically un-zips the download, all you have to do now is:
  4. sudo tar -zxvf <downloaded_file> -C /

That did it.

Not quite. Later on I got word that a ‘migrate.db’ failed. Searching about found this page from TechLiberty and this page from rubyonrails.org — both provide useful information buried in stuff I didn’t need, as they are dealing with the ‘regular’ version of Snow Leopard.

Bottom line: MySQL has to be installed as a 64-bit application. On Snow Leopard Server, the magic incantation is:

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

(Note the path to mysql_config is different than those pages; this is the ‘server’ difference.)


Another very nice thing Ryan showed me was the Unix “Locate” command. But first you have to build the locate database by issuing this command:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

The complete archive of the iChat between Ryan and myself is found in the iChat transcripts and in the “Internet related” folder on my main machine.

And the ‘locate’ database is rebuilt nightly, so don’t expect real-time updates.

May 27, 2010 12:52 PM

google_pluslinkedingoogle_pluslinkedinby feather

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.