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)
This did the trick (unbelievably, I hadn’t installed openssl via brew, though every other version of Ruby installed fine):
macOS 10.13 High Sierra Beta 2
CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 2.3.4Thank you @hugobastHi, 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…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:
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:
… worked …
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-buildworked for me!Followed that with
rbenv install 2.4.0and 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.8For macports, this worked for me…
RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/local/" rbenv install 2.4.1This might help https://coderwall.com/p/n9bnug
Summary:
Explicitly specifying openssl did the trick for me. Thanks @nathany
Works for me. macOS 10.14.6
Ubuntu 14:
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.
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