Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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
@nicolasblanco

This comment has been minimized.

Show comment Hide comment
@nicolasblanco

nicolasblanco Nov 6, 2012

Great 👍 !

On OS X Mountain Lion, I had to add also --with-gcc=clang to CONFIGURE_OPTS to avoid a compilation error.

Great 👍 !

On OS X Mountain Lion, I had to add also --with-gcc=clang to CONFIGURE_OPTS to avoid a compilation error.

@byennen

This comment has been minimized.

Show comment Hide comment
@byennen

byennen Nov 9, 2012

Thanks!

byennen commented Nov 9, 2012

Thanks!

@lpsBetty

This comment has been minimized.

Show comment Hide comment
@lpsBetty

lpsBetty Apr 5, 2013

hmmm i got the following error, when doing your rbenv command..

BUILD FAILED

Inspect or clean up the working tree at /var/folders/63/6371tP-tEXaPCC4JHxbmNU+++TI/-Tmp-/ruby-build.20130405124859.9988
Results logged to /var/folders/63/6371tP-tEXaPCC4JHxbmNU+++TI/-Tmp-/ruby-build.20130405124859.9988.log

Last 10 log lines:
x openssl-1.0.1e/VMS/TODO
x openssl-1.0.1e/VMS/ucx_shr_decc_log.opt
x openssl-1.0.1e/VMS/ucx_shr_decc.opt
x openssl-1.0.1e/VMS/ucx_shr_vaxc.opt
x openssl-1.0.1e/VMS/VMSify-conf.pl
x openssl-1.0.1e/VMS/WISHLIST.TXT
/var/folders/63/6371tP-tEXaPCC4JHxbmNU+++TI/-Tmp-/ruby-build.20130405124859.9988/openssl-1.0.1e /var/folders/63/6371tP-tEXaPCC4JHxbmNU+++TI/-Tmp-/ruby-build.20130405124859.9988 ~
Operating system: i686-apple-darwinDarwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
Configuring for darwin64-x86_64-cc
Usage: Configure [no- ...] [enable- ...] [experimental- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]

lpsBetty commented Apr 5, 2013

hmmm i got the following error, when doing your rbenv command..

BUILD FAILED

Inspect or clean up the working tree at /var/folders/63/6371tP-tEXaPCC4JHxbmNU+++TI/-Tmp-/ruby-build.20130405124859.9988
Results logged to /var/folders/63/6371tP-tEXaPCC4JHxbmNU+++TI/-Tmp-/ruby-build.20130405124859.9988.log

Last 10 log lines:
x openssl-1.0.1e/VMS/TODO
x openssl-1.0.1e/VMS/ucx_shr_decc_log.opt
x openssl-1.0.1e/VMS/ucx_shr_decc.opt
x openssl-1.0.1e/VMS/ucx_shr_vaxc.opt
x openssl-1.0.1e/VMS/VMSify-conf.pl
x openssl-1.0.1e/VMS/WISHLIST.TXT
/var/folders/63/6371tP-tEXaPCC4JHxbmNU+++TI/-Tmp-/ruby-build.20130405124859.9988/openssl-1.0.1e /var/folders/63/6371tP-tEXaPCC4JHxbmNU+++TI/-Tmp-/ruby-build.20130405124859.9988 ~
Operating system: i686-apple-darwinDarwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
Configuring for darwin64-x86_64-cc
Usage: Configure [no- ...] [enable- ...] [experimental- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]
@bigardone

This comment has been minimized.

Show comment Hide comment
@bigardone

bigardone Apr 7, 2013

Yes, I got the same error :(

Yes, I got the same error :(

@dvliman

This comment has been minimized.

Show comment Hide comment
@dvliman

dvliman Apr 8, 2013

@lpsBetty @bigardone Ran into same issue just now. You need to install xcode and run it for the first time. Additionally, you want to install xcode command line tools to for "make". Go to apple dev website. You can download it for free.

dvliman commented Apr 8, 2013

@lpsBetty @bigardone Ran into same issue just now. You need to install xcode and run it for the first time. Additionally, you want to install xcode command line tools to for "make". Go to apple dev website. You can download it for free.

@lpsBetty

This comment has been minimized.

Show comment Hide comment
@lpsBetty

lpsBetty Apr 18, 2013

i already have xcode command line tools installed.. (but not the full xcode)

i already have xcode command line tools installed.. (but not the full xcode)

@lpsBetty

This comment has been minimized.

Show comment Hide comment
@lpsBetty

lpsBetty May 15, 2013

got the same error when trying to install p195 :(

please tell me if this worked for you:
https://gist.github.com/lpsBetty/5584686

got the same error when trying to install p195 :(

please tell me if this worked for you:
https://gist.github.com/lpsBetty/5584686

@cbandy

This comment has been minimized.

Show comment Hide comment
@cbandy

cbandy May 15, 2013

Should be RUBY_CONFIGURE_OPTS

cbandy commented May 15, 2013

Should be RUBY_CONFIGURE_OPTS

@timcharper

This comment has been minimized.

Show comment Hide comment
@timcharper

timcharper Jun 13, 2013

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

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

@mohawkjohn

This comment has been minimized.

Show comment Hide comment
@mohawkjohn

mohawkjohn Jun 24, 2013

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.

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