Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install Ruby versions < 2.4 because of openssl@1.1 dependency #1353

Closed
brandonfriess-stripe opened this issue Oct 3, 2019 · 7 comments
Closed

Comments

@brandonfriess-stripe
Copy link

@brandonfriess-stripe brandonfriess-stripe commented Oct 3, 2019

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?

@hsbt

This comment has been minimized.

Copy link
Member

@hsbt hsbt commented 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 of brew install ruby-build

@gfguthrie

This comment has been minimized.

Copy link
Contributor

@gfguthrie gfguthrie commented 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 openssl
RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" rbenv install 2.3.8

(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

This comment has been minimized.

Copy link
Author

@brandonfriess-stripe brandonfriess-stripe commented Oct 3, 2019

Thanks! That will work and I am sure will be helpful for others who may land on this thread.

@aardvarkk

This comment has been minimized.

Copy link

@aardvarkk aardvarkk commented 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

kengorab pushed a commit to policygenius/laptop that referenced this issue Nov 5, 2019
  - `caskroom/cask` no longer needs to be tapped in newer versions of
homebrew: https://stackoverflow.com/a/58337898
  - Resolving openssl version conflict when installing ruby versions
with rbenv: rbenv/ruby-build#1353 (comment)
@wekb

This comment has been minimized.

Copy link

@wekb wekb commented Nov 8, 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 openssl
RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" rbenv install 2.3.8

(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)

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

This comment has been minimized.

Copy link

@hraban hraban commented 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

This comment has been minimized.

Copy link
Contributor

@gfguthrie gfguthrie commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.