Skip to content

Instantly share code, notes, and snippets.

@gmcmillan
Last active December 10, 2015 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmcmillan/4511351 to your computer and use it in GitHub Desktop.
Save gmcmillan/4511351 to your computer and use it in GitHub Desktop.

1. Install Xcode

2. Use XCode to install Command Line Utilities (GCC)

Open Xcode. Click the "Xcode" button in the top left of the screen near the Apple logo, then click "Preferences", then click "Downloads".

3. Install rbenv:

$ git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

4. Install ruby-build:

$ mkdir -p ~/.rbenv/plugins
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ source ~/.bash_profile

5. Compile Ruby

$ env CC=/usr/bin/gcc rbenv install 1.9.3-p362
$ rbenv global 1.9.3-p362
$ rbenv rehash

6. Verify it works:

$ ruby -v
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-darwin12.2.1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment