Mountain Lion and Rails development

Mac — squarism @ 7:52 pm


If you do development on a Mac, you might be considering upgrading to Mountain Lion because of speed improvements and you greatly desire a notes application with a skeuomorphic leather-bound notes application. :)

I was afraid to take the plunge early so last night I did a test upgrade on a Mac that is not my main dev one.

Get Xcode working
First of all, you can follow this gist:

They have you go to developer.apple.com to get Xcode 4.4 but you can also use the App Store’s upgrade button. Step #2 explicitly has you download the command line tools for Xcode but you can also use the Xcode 4.4 command line tools for 10.8 from the developer site. Both of these downloads are under 300mb.

Also, please note that there are many, many forks of that gist above. Some just include extra screenshots in case you aren’t familiar with Xcode but some follow very different steps. I pretty much followed just the ‘master’ fork of that gist to get Xcode working.

Fix Bundler
But then I did a `bundle` in a rails project that uses a native lib (eventmachine) and bundle puked because it couldn’t find gcc-4.2 in my path. It looked something like this:

Because Xcode 4.4 is LLVM based. So I followed the rest of the ruby specifc bits on thoughtbot. Specifically, the “Fix Homebrew + install GCC” section. The rest of the blog post is handled by the gist above.

Things seem to work but my test box is not my day-to-day dev box. I thought I’d share so you guys know that it’s not an automatic upgrade for devs. Definitely do the upgrade over the weekend or with some downtime.

Brew upgrade
You might run a brew update && brew upgrade regularly to keep your libraries and apps up to date but it installs multiple versions. So you run a brew cleanup to remove old versions. Well beware of some changes I’ve seen (I don’t know the timeframe). Conf files might be in the old versions. For example, my mongod.conf was under /usr/local/Cellar/mongodb/#{old_version} but brew cleanup removed that directory. Luckily, I just had the default config file in there. The new location is /usr/local/etc/mongod.conf (as it should be). I’ve seen this in other packages too. Some packages have changed over the years so just take a look at your filesystem paths and config file locations. If you reinstall brews for the Mountain Lion upgrade or do a brew cleanup make sure files you want to save won’t be lost when doing a `brew remove` or `brew cleanup`.

Also, the launchagent plists have changed.
ls ~/Library/LaunchAgents
homebrew.mxcl.mysql.plist (the file used to be called org.mysql.plist)

So when upgrading, homebrew will tell you to launchctl unload the old one. But homebrew won’t tell you that the name has changed. Just something else to watch out for. If you delete the old file before launchctl unloading, you’ll have a few extra steps to do for forcefully unload it. Not a big deal. Just follow homebrew’s instructions but also realize that they won’t tell you that the filename has changed.

0 Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2013 SQUARISM | powered by WordPress with Barecity