ruby-build: The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

rbenv install 2.0.0-p247 fails on Mac OS X 10.8.4 with the error:

The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

I had no problem installing 1.9.3-p448.

Using ruby-build 20130628 via Homebrew.

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 85 (4 by maintainers)

Commits related to this issue

Most upvoted comments

This did the trick (unbelievably, I hadn’t installed openssl via brew, though every other version of Ruby installed fine):

brew install openssl
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.1e rbenv install 2.0.0-p247

macOS 10.13 High Sierra Beta 2 CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 2.3.4 Thank you @hugobast

Hi, for Debian Stretch and ruby 2.2.3 install:

apt-get install libssl1.0-dev

not libssl-dev, then apply this:

https://github.com/rbenv/ruby-build/issues/834#issuecomment-160627207

using RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/[latest version] rbenv install [version] worked for me finally…

using RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/[latest version] rbenv install [version] worked for me finally…

First, thank you so much. I failed at the beginning because I copied the commands above guys’ . You help me out of the trouble.

Here the exactly what we should do:

# look into your real openssl version, as for me is `1.0.2s`
ls /usr/local/Cellar/openssl/
# then to confirm the ruby version you need, as for me is `2.3.3`
# implement the command
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2s rbenv install 2.3.3

God bless you.

I’m sorry to say this but on macOS 10.12 with latest ruby-build this is still an issue. I brew installed openssl and I still have a hell of a time in making it play nice with rbenv install.

It’s really unfortunate but this:

CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`"

… worked …

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build worked for me!

Followed that with rbenv install 2.4.0 and everything is hunky-dory.

I was having this issue with OSX 10.15.3. The version of openssl that homebrew installed was 1.1 and I was trying to install ruby 2.3.8, which did not work.

I eventually got it to work using openssl version 1.0.2.

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

For macports, this worked for me…

RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/local/" rbenv install 2.4.1

This might help https://coderwall.com/p/n9bnug

Summary:

brew link openssl --force

Explicitly specifying openssl did the trick for me. Thanks @nathany

using RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/[latest version] rbenv install [version] worked for me finally…

Works for me. macOS 10.14.6

Ubuntu 14:

sudo apt-get install libssl-dev

This is fixed in a later release of PostgresApp https://github.com/PostgresApp/PostgresApp/releases/tag/9.2.4.3 as per issue https://github.com/PostgresApp/PostgresApp/issues/116.

So if anyone on OS X experiences this issue, either update to the latest ruby-build and brew install openssl, or update PostgresApp.

  • OS X 10.9 Mavericks
  • brew for rbenv: stable 0.4.0, HEAD
  • brew for ruby-build: stable 20131024, HEAD
  • no ~/.rbenv/plugins folder (fresh install)

With brew for openssl: stable 1.0.1e (but keg-only, not linked)

rbenv install 2.0.0-p247 # works fine now. thanks for the fix!

Without brew install openssl, and without PostgresApp in my path:

/usr/bin/openssl # OpenSSL 0.9.8y 5 Feb 2013

rbenv install 2.0.0-p247 # Downloading openssl-1.0.1e.tar.gz… also works fine.

Without brew install openssl, but PostgresApp 9.2.4.1 in my path:

rbenv install 2.0.0-p247 # The Ruby openssl extension was not compiled. Missing the OpenSSL lib? rbenv install 1.9.3-p448 # still works fine

This is the situation I originally reported, and I think it confirms that PostgresApp’s copy of openssl was somehow getting in the way.

@danielb2 I got the same error with CFLAGS='-g -O2' RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.1e rbenv install 2.0.0-p247