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

conflicts Homebrew's OpenSSL and local LibreSSL #1277

Closed
lufia opened this issue Jan 23, 2019 · 3 comments
Closed

conflicts Homebrew's OpenSSL and local LibreSSL #1277

lufia opened this issue Jan 23, 2019 · 3 comments

Comments

@lufia
Copy link

lufia commented Jan 23, 2019

On my mac, Homebrew is installed at /opt/homebrew because /usr/local is used for other programs. And also, LibreSSL is installed at /usr/local.

In case of above, gem of Ruby that built with rbenv crashes:

$ rbenv install
ruby-build: use openssl from homebrew
Downloading ruby-2.6.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0.tar.bz2
Installing ruby-2.6.0...
ruby-build: use readline from homebrew
Installed ruby-2.6.0 to /Users/lufia/pkg/rbenv/versions/2.6.0

$ gem install bundle
dyld: lazy symbol binding failed: Symbol not found: _SSL_CTX_set_min_proto_version
  Referenced from: /Users/lufia/pkg/rbenv/versions/2.6.0/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle
  Expected in: flat namespace

dyld: Symbol not found: _SSL_CTX_set_min_proto_version
  Referenced from: /Users/lufia/pkg/rbenv/versions/2.6.0/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle
  Expected in: flat namespace

SSL_CTX_set_min_proto_version is declared in LibreSSL's /usr/local/include/openssl/ssl.h, but Homebrew's OpenSSL don't have.

I tried to build ruby without ruby-build:

$ cd ruby-2.6.0
$ CFLAGS='-I/opt/homebrew/opt/openssl/include' make

Then, gem don't crash.

How to do give priority to /opt/homebrew/opt/openssl/include ?

@mislav
Copy link
Member

mislav commented Jan 23, 2019

You can try something like

RUBY_CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 2.6.0

However, the ruby-build: use openssl from homebrew line of output in what you reported above suggests that ruby-build tried to use that openssl dir automatically. I'm not sure what exactly is the problem here.

@lufia
Copy link
Author

lufia commented Jan 24, 2019

I tried RUBY_CONFIGURE_OPTS=... but result still crash.

If /usr/local/include/openssl is not exist, then rbenv install builds correct binary.

$ cd /usr/local/include
$ sudo mv openssl _openssl
$ rbenv install 2.6.0
$ gem install bundle
Fetching bundle-0.0.1.gem
Successfully installed bundle-0.0.1
Parsing documentation for bundle-0.0.1
Installing ri documentation for bundle-0.0.1
Done installing documentation for bundle after 0 seconds
1 gem installed

@hsbt
Copy link
Member

hsbt commented Apr 12, 2021

How to do give priority to /opt/homebrew/opt/openssl/include ?

Use or google DYLD_LIBRARY_PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants