czvaew
Last Updated: February 25, 2016
·
4.466K
· defeated
648805ae18e92b7c71e46f3caa23ddc8

Build Ruby 2.0.0-p0 on OS X using rbenv

Great news, everyone! So ruby 2.0.0-p0 was released today, just shy of ruby's 20th anniversary!

Naturally I ran into 2(.0.0) problems:

  1. Unfortunately, the version of openssl shipped with OS X (even on Mountain Lion) is out-of-date.

  2. I use rbenv but it hasn't been updated with a definition for 2.0.0-p0 yet.

I could download ruby manually and do the configure / make / make install dance...

Create a ruby-build definition file

.. or we can use rbenv with a custom definition file! Create that by running:

$ echo 'install_package "ruby-2.0.0-p0" "http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz"' > ./custom-2.0.0-p0

Update OpenSSL

To fix openssl, use Homebrew to install a current version:

$ brew update && brew install openssl

Put it all together

Use ruby-build's support for the CONFIGURE_OPTS environment variable to use the updated openssl library when compiling, and point rbenv at our custom definition file:

$ CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install ./custom-2.0.0-p0
Say Thanks
Respond

3 Responses
Add your response

4373
88eb5665f537eacf51a2677aeaf1816b

Mmm: configure:

WARNING: unrecognized options: --with-openssl-dir

over 1 year ago ·
4379
648805ae18e92b7c71e46f3caa23ddc8

it works, but apparently rbenv passes CONGFIGURE_OPTS to dependent libraries as well.

per https://github.com/sstephenson/ruby-build we can use RUBY_CONFIGURE_OPTS instead which are just for building MRI.

nice catch!

over 1 year ago ·
4391
4201826647e97b55d4c80a5ed7661f29

use --with-opt-dir instead.

over 1 year ago ·