Installing ruby with rbenv and homebrew on os x mavericks

It’s a bit tricky to install Ruby on Mac OS X Maverick (10.9), but here’s what worked for me.

  1. Upgrade to Mavericks:
  2. Upgrade to Xcode 5:
  3. Install the old C compiler to support apps on Ruby 1.8: brew install apple-gcc42
  4. Let the old compiler know about Xcode 5. Add this to your shell config file in your home directory:
# XCode 5 hides these away:
export C_INCLUDE_PATH="$(xcrun --show-sdk-path)/usr/include"
export CPLUS_INCLUDE_PATH="$(xcrun --show-sdk-path)/usr/include"
export LIBRARY_PATH="$(xcrun --show-sdk-path)/usr/lib:$(xcrun --show-sdk-path)/usr/lib/system:$LIBRARY_PATH"

Follow me on Twitter to keep up with what I’ve learned building my personal finance tool, Stash.

Read more posts …
Written: June 24th, 2013
Categories: mac, osx, 10.9, rbenv, ruby, homebrew