Skip to content

Instantly share code, notes, and snippets.

@timcharper
Last active December 18, 2015 11:49
Show Gist options
  • Save timcharper/5778185 to your computer and use it in GitHub Desktop.
Save timcharper/5778185 to your computer and use it in GitHub Desktop.
For rbenv and without using ruby-build, how to install ruby-2.0.0-p195 with a working openssl.

ruby-build failed me, so I took matters into my own hands. Here's what worked

download and extract ruby 2.0.0p-195 to ~/.rbenv/src/ruby-2.0.0p195

mkdir $HOME/.rbenv/src
cd $HOME/.rbenv/src
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.tar.gz
tar xzf ruby-2.0.0-p195.tar.gz

Install openssl-0.9.8 with homebrew (assumes homebrew is installed to /usr/local)

cd /usr/local/Library
git checkout a2e8b543f16745025001790777770b190b5d9a64
brew install openssl
git checkout master # switch it back

Build ruby. (openssl will fail)

cd ~/.rbenv/src/ruby-2.0.0-p195
./configure --prefix=$HOME/.rbenv/versions/2.0.0-p195
make -j 8 # cores * (hyperthreading ? 2 : 1)
make install

set to use ruby interpreter. At this point, ruby 2.0 works but openssl library will not load.

rbenv local 2.0.0-p195

Build openssl against openssl-0.9.8:

cd ext/openssl
ruby extconf.rb  --with-openssl-dir='/usr/local/Cellar/openssl/0.9.8/'
make
make install

You should have fully functioning ruby 2.0 with openssl!

@scottmagdalein
Copy link

@timcharper Have you made any progress? No solutions are working for me with Ruby 2.0.0-p247 and openssl 1.0.1e.

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