Well, as usual, I thought a minor headache would stay minor, but it turned into a migraine. Like many robust Rails apps, Mavenlink has quite a few gem dependencies and my upgrade to Snow Leopard required me to rebuild quite a few things. What I've seen online seems to be a lot of one-off issues and 'getting rails running under SL,' but nobody has tackled the big update.
In Tarantino-esque style, where I'll show you the end before we start, here were the gems I needed to update:
mongrel 1.1.5
MySQL 2.7.3 => 2.8.1
taf2-curb 0.3.5.0 => 0.5.2.0
rmagick 2.9.1 => 2.11.1
nokogiri 1.3.1 => 1.3.3
As someone without gobs of rails experience, the news to me was that some of these gems are compiled based on your architecture and the dead giveaway is an error message similar to, or matching "...no matching architecture in universal wrapper..." in your stack trace on any of your gems upon script/server-ing.
Here was my process and a bunch of the resources that helped me and some of the things I needed to do to get my dependencies updated:
Install XCode
First, as these posts point out, you absolutely, positively have to reinstall XCode to get GCC 64-bit rocking, otherwise you won't be able to compile anything (i.e. your gems):
http://www.curtismchale.ca/tutorials/getting-macports-and-git-working-on-snow...
http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard
Don't do what I started to do before reading many of these posts (i.e. download it) - it's on your Snow Leopard DVD. You will find it in the Optional Installs dir. Install takes about 15-20 minutes and I didn't have to uninstall the old XCode. YMMV.
Install MySQL 64bit
Next, I wasn't having any issues with MySQL, but Matt Aimonetti (above rubyonrails.org blog) recommends an upgrade. I did that by going to the MySQL download site http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg and getting from a mirror. Unfortunately, for whatever reason, they were all linked to an older version and I ended up having to Google it to find a download, but you want the newest x86_64bit version. Install the DB, then the StartupItem then the prefPane, all by double clicking. I had to restart to get my old install to die and the new one started.
Not bad yet, right? Just the usual Mac installation stuff. No Advil required.
WEBrick???
Consider this the Pulp Fiction foot massage scene - kind of random and a foreshadowing of things to come. In Tarantino's case, his documented foot fetish. In our case, odd behaviors and, therefore, headaches.
When trying to restart script/server, I noticed that it was trying to start under WEBrick, but not necessarily erroring. I use mongrel. Fortunately, the fix was pretty easy. I started reading about people uninstalling mongrel, etc. I found that unecessary - just:
$ sudo gem install mongrel
That did the trick for me.
First Volley of Gems
At this point, you can definitely install the new MySQL gem. Check out these directions, which helped clarify it for me:
http://norbauer.com/notebooks/code/notes/snow-leopard-upgrading-for-rails-dev...
If you want to skip ahead, I just did this:
$ sudo gem uninstall mysql
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
You're also ready to update taf2-curb if you've got it installed. I'm using pauldix-feedzirra, which requires taf2-curb, so that's my dependency. This was really straightforward after I realized I needed to update my gem sources. Since taf2-curb is on GitHub, you need that in your sources.
$ gem sources
if you don't see "http://gems.github.com" in the output, run
$ sudo gem sources -a http://gems.github.com
then you can
$ sudo env ARCHFLAGS="-arch x86_64" gem install taf2-curb
(if you don't have github in your sources, you'll get: "Error: Could not find taf2-curb locally or in a repository!")
MacPorts, or Headaches with Nokogiri
I pray this will help you, because this was where the real migraine kicked in for me. I did the MacPorts update/upgrade/reinstall like everyone was saying in some of my earlier links to the overview posts. However, I just could not get Nokogiri installed. If this looks familiar, you are probably at this step:
[RubyGems:stderr] ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension.
...
checking for xmlParseDoc() in -lxml2... nolibxml2 is missing. try 'port install libxml2' or 'yum install libxml2'*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers. Check the mkmf.log file for moredetails. You may need configuration options.
The key for me was "try 'port install libxml2'" in the above trace. Reading that made me think it was a MacPorts issue and I was doing something wrong.
I read this about 10 times before I had the "aha":
http://groups.google.com/group/nokogiri-talk/browse_thread/thread/bd996cee8c3...
If you notice, in Joe C's last post, he says he did a clean install of SL, XCode, etc and THEN did a nokogiri install. Nowhere in his list does he have MacPorts installed. I took a crack at uninstalling MacPorts completely after all my upgrade machinations, etc and the nokogiri gem installed!
Check out this site for uninstalling MacPorts:
http://trac.macports.org/wiki/FAQ#uninstall
I ran the first 2 commands.
RMagick
Now, you're ready for RMagick/ImageMagick. Go here, do not pass Go, do not collect $200, and run Solomon's script:
http://onrails.org/articles/2009/09/04/rmagick-from-source-on-snow-leopard
This was the easiest thing I did all day and was wayyy easier than going through MacPorts, etc as I did for ImageMagick/RMagick last time. It worked right out of the box for me, YMMV.
Obviously, download it, chmod 777 it, ./ it.
Fin
So, that was a few hours out of my day - hopefully this saves somebody the same headaches I had. Please let me know through comments if this helps or if there are any additions/corrections based on your mileage that I should make.
I still haven't reinstalled MacPorts and I'm wondering if I'll be running into future issues. If people have thoughts, let me know. I notice every site that I've linked to has that installation as part of the base upgrade to Snow Leopard.