Closed
Description
It seems the most recent change to ruby-build 20191002 homebrew formula to require openssl@1.1 breaks the install of Ruby versions that are < 2.4 (those require openssl 1.0.2q)
So, for macOS users who install ruby-build via homebrew, they will get openssl@1.1 installed as well.
If they then try to run rbenv install 2.1.10
for instance, it will fail with:
Last 10 log lines:
The Ruby openssl extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/username/.rbenv/versions/2.1.10
--with-openssl-dir=/usr/local/opt/openssl@1.1
--with-readline-dir=/usr/local/opt/readline
CC=clang
CFLAGS= -O3 -Wno-error=shorten-64-to-32
LDFLAGS=-L/Users/username/.rbenv/versions/2.1.10/lib
CPPFLAGS=-I/Users/username/.rbenv/versions/2.1.10/include
Yeah, I know older versions are EOL but they still get used in some environments.
Seems like changing https://github.com/rbenv/ruby-build/blob/master/bin/ruby-build#L1023 to only check for openssl
and not `openssl@1.1 could potentially fix this?
Activity
hsbt commentedon Oct 3, 2019
I understand this issue too. But I didn't know the maintenance policy of ruby-build formula on homebrew.
I suggest you use
git clone
instead ofbrew install ruby-build
gfguthrie commentedon Oct 3, 2019
Since I helped move the 1.1 change along:
The workaround for EOL Ruby versions (or any that won't build with 1.1) where you still want to use Homebrew is as follows:
brew install opensslRUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" rbenv install 2.3.8Latest solution/workaround (March 2020): #1353 (comment)
(FWIW, the Homebrew formula was updated to use 1.1 at the end of August, the recent change was just to start looking for that version)
brandonfriess-stripe commentedon Oct 3, 2019
Thanks! That will work and I am sure will be helpful for others who may land on this thread.
aardvarkk commentedon Oct 4, 2019
I ran into this bug when trying to install Ruby 2.3.8 using the ASDF version manager. I was getting the following error when running:
asdf install ruby 2.3.8
:ERROR: Ruby install aborted due to missing extensions
Following the example above, I changed the command to the following and the installation worked correctly:
RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" asdf install ruby 2.3.8
Fixing minor issues in mac setup script
wekb commentedon Nov 8, 2019
This is very helpful, but frankly this should not have been a breaking change. Adding logic, or at least some kind of user feedback, would have been trivial in this case.
hraban commentedon Nov 8, 2019
Thanks for the explanation and solution.
Even just a link to this issue would be a great help to anyone using rbenv to install a <2.4.0 on mac. Many people will be running into this problem, not all of them confident enough to google the right error message (rbenv is usually part of a "run this to setup the repo" list in project READMEs).
gfguthrie commentedon Nov 8, 2019
I've taken option 2 from my comment on the original PR and made a new PR (#1375) to stop looking for Homebrew openssl entirely so that the discussion can focus there about whether that's the approach
ruby-build
wants to move towards or not.LoadError
when attempting to use openssl rvm/rvm#4819hardvain commentedon Jan 6, 2020
Hello, I still seem to have this error. I am trying to instal ruby 2.3.7. My mac has openssl version
1.1.d 10 Sep 2019
. I am getting the following error when trying to install ruby even after passing the above suggested method of including open-ssl-dir. The last few lines of the error is:Am I missing anything? The command I am trying to run is
RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" rbenv install 2.3.7
gfguthrie commentedon Jan 6, 2020
@hardvain you probably don't need to pass the option at all. 2.3.7 I don't think will work with 1.1, and from the error it looks like you don't have anything in
/usr/local/opt/openssl
. If you don't pass in anything,ruby-build
(assuming you have the current version) will just install theopenssl
that is needed for 2.3.7.56 remaining items