Monday, June 7, 2010

Damn You Snow Leopard...

We recently finished our upgrade to Exchange 2010, which set off a chain reaction of events that destroyed my development environment. I had been using IMAP to connect Apple's mail client to our Exchange 2003 server. IMAP is turned off by default in Exchange 2010, and Snow Leopard supports natively connecting to Exchange. As such, I thought it was a perfectly good excuse to upgrade from Leopard. This was not a great idea.

Apple bundles an update version of Ruby (1.8.7) with Snow Leopard, which clobbered the rather messy development stack I'd been running on my laptop. (Having started really working with Ruby and Rails back when you had to run everything in Webrick, moving to nginx, mongrel clusters, and finally settling on passenger over a span of at least a few ruby and rails versions, it was rather fragile.

I spent somewhere on the order of 8-10 solid hours trying to fix it. (Installed RVM in the hopes that I'd get some help from a clean version of Ruby. Nope. Rebuilt almost everything. Nope.) Ultimately I decided it would likely be easier to start over with a fresh install of Snow Leopard on a blank drive and rebuild a clean stack from scratch.

So here's what I ultimately ended up doing. (Note that this would be what you need to do in order to get started with Rails on Snow Leopard. I'll add command line snippets shortly, but most of this is pretty straightforward stuff.)

  1. Back up everything to a time machine drive
  2. Insert the Snow Leopard DVD
  3. Boot up for an installation
  4. Use disk utility to wipe my hard drive (scary.)
  5. Reinstall a clean version of Snow Leopard
  6. Install XCode from the "Optional Installs" on the Snow Leopard DVD
  7. Update Rubygems
  8. Download and install MySQL binary
  9. Create .profile and add /usr/local/bin to my path
  10. Install the mysql gem with 64 bit archflags directive
  11. Install rails 2.3.
  12. Install the passenger gem
  13. Configure passenger [sudo passenger install-apache2-module]
  14. Install the passenger preference pane
  15. Success!!