Last Updated: July 31, 2018
· kjohnston

Upgrading to Mountain Lion

Prem Sichanugrist put together a very helpful Hitchhiker's Guide to Riding a Mountain Lion that outlines most of the process for upgrading to Mountain Lion and getting RVM, Homebrew and the like back on track.

In going through this process I had to take a few additional steps to get things dialed in:

Using only the CLI developer tools (and not XCode)

Since I don't use XCode and despise uninstalling, downloading an updating it every few months, I wanted to avoid it this go around.

It turns out that the CLI tools by themselves (without XCode) suffice for my Ruby environments and Rails projects. So I blew away XCode 4.2.1 and downloaded the latest developer tools from http://developer.apple.com/downloads/index.action.

GCC configuration

I run late model and classic versions of Ruby under RVM, so I installed old GCC:

brew tap homebrew/dupes
brew install apple-gcc42

But, brew installs apple-gcc42 to /usr/local/bin/gcc-4.2, so I had to adjust my CC path in ~/.profile:

export CC=/usr/local/bin/gcc-4.2

(I had previously been using /usr/bin/gcc-4.2)

I had to reinstall ImageMagick, as I always do after an OS upgrade, and that went well after updating brew.

Reinstalling the rmagick gem is my typical test case for making sure my ImageMagick installation is solid. Despite the CC path setting mentioned above, I found that I also needed to symlink the apple-gcc42 version of gcc-4.2 to the location where it is expected to be during gem installation (as opposed to rvm ruby installations which listen to the CC path):

sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2

Ruby installations via RVM

You should always make sure you can compile rubies after going through an OS upgrade.

Reinstalling 1.9.2 and 1.9.3 rubies via RVM went smoothly for me, but I had to pass an extra flag to appease ree-1.8.7:

CFLAGS="-I/opt/X11/include" rvm reinstall ree

But, what about MacPorts?

If you need help getting MacPorts back on track as well, see my colleague Phil Cohen's post on the subject:

Upgrading to Mountain Lion - Ruby + MacPorts.

4 Responses
Add your response


This is not true, because command line tools don't include the header files which Xcode has. You might run into this if you try to compile something which uses OS X native APIs.

over 1 year ago ·

@darthdeus, thanks for the comment. I'm confused as to what you're referring to though. Can you provide some more detail? I can update the post if something is incorrect.

over 1 year ago ·

I also would not recommend installing the command line tools separately. I had far fewer problems installing them from XCode directly.

over 1 year ago ·

I installed command line tools from xcode
I set CC to /usr/bin/gcc I'm still getting this with rvm:

"Ruby 'ruby-xxxx' was built using clang - but it's not (fully) supported, expect errors."

Any ideas?


I have a fresh install of Mountain Lion so I had to follow this post exactly, installing the apple-gcc42 package.

over 1 year ago ·