Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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: https://developer.apple.com

2. Install the Command Line Tools (CLT)

http://adcdownload.apple.com/Developer_Tools/command_line_tools_os_x_10.10_for_xcode__june_2014/command_line_tools_for_osx_10_10_june_2014.dmg (thanks @thomaslindstrom)

3. Install Homebrew

Copy/pasted from the site:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

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" ]
#then
#    exec "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"
#else
    exec ruby -W0 "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"
#fi

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.

@jimbocortes
Copy link

jimbocortes commented Jun 17, 2014

had to do this
CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl --with-gcc=clang" rbenv install 2.1.2

or else

BUILD FAILED

Inspect or clean up the working tree at /var/folders/96/06k_d7m11cxf6z245d451_mr0000gn/T/ruby-build.20140617151358.28674
Results logged to /var/folders/96/06k_d7m11cxf6z245d451_mr0000gn/T/ruby-build.20140617151358.28674.log

Last 10 log lines:
checking for gcc-4.2... gcc-4.2
couldn't understand kern.osversion 14.0.0' checking for gcc... (cached) gcc-4.2 checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in/var/folders/96/06k_d7m11cxf6z245d451_mr0000gn/T/ruby-build.20140617151358.28674/ruby-2.1.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use --host'. Seeconfig.log' for more details

@rkeniger
Copy link

rkeniger commented Jun 18, 2014

The OpenSSL stuff didn't work for me, but just using CONFIGURE_OPTS="--with-gcc=clang" rbenv install 2.1.1 worked fine. Thanks for the tip.

@danielbayerlein
Copy link

danielbayerlein commented Jun 28, 2014

Command Line Tools for OS X Yosemite 10.10

@chrisdelbuck
Copy link

chrisdelbuck commented Jul 3, 2014

CLT Download link fails for me unless coming directly from https://developer.apple.com/downloads/index.action

@dja
Copy link

dja commented Jul 19, 2014

@rkeniger That worked awesomely. Thanks!

@bdcheung
Copy link

bdcheung commented Jul 25, 2014

@rkeniger Worked for me too, thanks!

@Nikamura
Copy link

Nikamura commented Aug 7, 2014

You can install CLT tools by entering

    gcc

in terminal

@philippbosch
Copy link

philippbosch commented Sep 2, 2014

The OpenSSL configure options in @jimbocortes' comment were f***ed up by the markdown parser, I believe. This worked for me:

CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-gcc=clang" rbenv install 2.1.2 

@caseyhelbling
Copy link

caseyhelbling commented Sep 8, 2014

@philippbosch that worked for me. Thanks!

@fskirschbaum
Copy link

fskirschbaum commented Oct 7, 2014

macbookpro:~ fskirschbaum$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Whoops, the Homebrew installer has moved! Please instead run:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Also, please ask wherever you got this link from to update it to the above.
Thanks!

@Miladiir
Copy link

Miladiir commented Oct 9, 2014

@fskirschbaum Homebrew works fine with Yosemite now, even without following this gist.

@pph7
Copy link

pph7 commented Nov 26, 2014

Works for me. Thx!

@dsibiski
Copy link

dsibiski commented Jan 21, 2015

@philippbosch Thank you so much! After trying tons of different commands and options, this is the only one that finally worked.

@iSevenDays
Copy link

iSevenDays commented Jan 22, 2015

THANKS! Struggled for hours!

@doctorallen
Copy link

doctorallen commented Mar 10, 2015

I just installed this and it told me to get you to update the curl command for installing homebrew.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

@HenriqueCarvalho
Copy link

HenriqueCarvalho commented Sep 12, 2015

@scottfister, thank so much! You solved my problem that I have been studying it for 3 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment