Skip to content

Instantly share code, notes, and snippets.

@sferik
Created November 5, 2012 02:28
Show Gist options
  • Star 35 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save sferik/4014963 to your computer and use it in GitHub Desktop.
Save sferik/4014963 to your computer and use it in GitHub Desktop.
Instructions to install on Ruby 2.0.0 on Mac OS X with homebrew
#!/usr/bin/env sh
brew update
brew install rbenv
brew install ruby-build
brew install openssl
CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-preview1
@cbandy
Copy link

cbandy commented May 15, 2013

Should be RUBY_CONFIGURE_OPTS

@timcharper
Copy link

I still had issues. I had to add a few lines to the top of ext/openssl/openssl_missing.h in addition to specifying homebrew installed openssl. Details of what worked for me here: https://gist.github.com/timcharper/5778185

@translunar
Copy link

Here's the command I used for installing for development purposes --

CC=gcc-4.7 RUBY_CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline` --with-gcc=gcc-4.7 --enable-shared" rbenv install --keep 2.0.0-p195

The -k is for --keep, which I seem to need since I'm developing Ruby C extensions.

I also found it necessary to use CC=gcc-4.7 because otherwise it would ALWAYS insist upon appending this Wshorten-64-to-32 flag, no matter which compiler I was using to build extensions. --with-gcc=gcc-4.7 is insufficient.

Note: This also seems to work with later GCC versions. I've tested with 4.8 and 4.9 also, but it's been a while.

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