6/3/2014 - 8:05 AM

Homebrew, Ruby, and Rails on OS X 10.10

Homebrew, Ruby, and Rails on OS X 10.10

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at:

2. Install the Command Line Tools (CLT) (thanks @thomaslindstrom)

3. Install Homebrew

Copy/pasted from the site:

ruby -e "$(curl -fsSL"

4. Update the brew Script

Open up /usr/local/bin/brew with your favorite editor.

I had to comment out the brew system detection, so that the last 6-7 lines looked like this:

#BREW_SYSTEM=$(uname -s | tr "[:upper:]" "[:lower:]")
#if [ "$BREW_SYSTEM" = "darwin" ]
#    exec "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"
    exec ruby -W0 "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"

5. Point Ruby 1.8 at Ruby 2.0

It looks like Homebrew somehow depends on Ruby being in Versions/1.8 (though even Mavericks ships with 2.0). Until Homebrew addresses this, we'll symlink our system version of Ruby to the one Homebrew looks for.

Create the folder:

sudo mkdir -p /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin

Then symlink the binary:

sudo ln -s /usr/bin/ruby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

6. Hack away!

My subsequent brew install commands seemed to work fine (ruby-build, redis, etc...). Along with rbenv, etc.

You'll probably need to install Bundler with gem install bundler if you haven't already.

Improve this Gist!

Leave a comment if something didn't work.