Installing openssl in ruby / rbenv Installing openssl in ruby / rbenv ruby ruby

Installing openssl in ruby / rbenv


For Mac OSX this is what saved me:

RUBY_CONFIGURE_OPTS=--with-openssl-dir=<openssl install dir> rbenv install

From the Ruby build wiki

But.. how to find the openssl install dir?:

$ brew list openssl/usr/local/Cellar/openssl/1.0.2d_1/bin/c_rehash/usr/local/Cellar/openssl/1.0.2d_1/bin/openssl...

Then the openssl install dir is:

/usr/local/Cellar/openssl/1.0.2d_1/

And the ruby installation command ends as this:

RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2d_1/ rbenv install


openssl needs to be installed on your local machine.

You then need to compile Ruby with openssl support, which is achieved via the --with-openssl-dir command-line switch.

Maybe this will help you.


First, install openssl:

sudo apt-get -y install build-essential zlib1g-dev libreadline-dev libssl-dev libcurl4-openssl-dev

Afterwards, recompile Ruby.

Note: Only fixing the comment from @Nebojsa above