How to make OSX Mountain Lion play nice with Ruby / Python / Node

Published on March 20, 2013 by Toran Billups

Last month I bought my first retina macbook pro. And like any developer I assumed it would be dead simple to get a ruby/python/node development environment up and running. But after 2 days of trial and error (reading old blog posts on the subject from anyone and everyone), I finally came up with a complete script that worked on the latest build of OSX Mountain Lion.


# https://developer.apple.com/downloads/index.action
# 1.) download + install XCode from the app store
# 2.) download + install the XCode command line tools from the url above
# 3.) open Xcode for the first time and agree to the terms of use

# install homebrew and install libksba
ruby -e \"$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)\"
brew doctor
brew update
brew install libksba

# install rvm -fix gcc and install ruby 2.0 + 1.9.3
curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
rvm install 1.9.3-p392

# install the fundamentals
brew install node
brew install phantomjs
brew install ack
brew install ctags
brew install tmux
brew install postgresql
brew install mysql
brew install mongo

# install a few RubyGems
gem install bundler rails pg foreman thin --no-rdoc --no-ri

# install pip and virtualenvwrapper
sudo easy_install pip
sudo pip install virtualenvwrapper


If you follow the above you will end up with a development machine running ruby 1.9.3 / python 2.7.2 and the latest node.js (hope this solves the automation problem for someone else next time around)