Can't reinstall on OS X with openssl 1.0.2a-1 #602

Closed
firedev opened this Issue Jun 12, 2015 · 26 comments

Projects

None yet
@firedev
firedev commented Jun 12, 2015

Just installed El Capitan and can't install gem eventmachine 1.0.7. Any suggestions are really appreciated. Thanks.

$ ls /usr/local/Cellar/openssl/1.0.2a-1/include/openssl/ssl.h
/usr/local/Cellar/openssl/1.0.2a-1/include/openssl/ssl.h

$ gem install eventmachine -v '1.0.7' -- --with-ssl-dir=/usr/local/Cellar/openssl/1.0.2a-1/include
/Users/pain/.rbenv/versions/2.1.2/bin/ruby -r ./siteconf20150612-56154-1hsjz2n.rb extconf.rb --with-ssl-dir=/usr/local/Cellar/openssl/1.0.2a-1/include
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue... yes
checking for clock_gettime()... no
checking for gethrtime()... no
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling binder.cpp
In file included from binder.cpp:20:
./project.h:116:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
         ^
1 error generated.
make: *** [binder.o] Error 1

make failed, exit code 2

@firedev firedev changed the title from Can't reinstall on OS X 10.11 El Capitan, ruby 2.1.2, openssl 1.0.2a-1 to Can't reinstall on OS X with openssl 1.0.2a-1 Jun 12, 2015
@ariperez

This seems to have worked for me:

gem install eventmachine -v '1.0.3' -- --with-cppflags=-I/usr/local/opt/openssl/include

Not really sure what is happening but I saw this when installing openssl:
image

and then stumbled upon this method for declaring the flag:
http://serverfault.com/questions/577944/gem-install-append-cppflags-ldflags

Would be interested in knowing the actual fix.

@firedev
firedev commented Jun 15, 2015

Amazing, thanks. They probably forgot to add this information to the current brew info for openssl:

$ gem install eventmachine -v '1.0.7' -- --with-cppflags=-I/usr/local/opt/openssl/include                                                                                                             
Building native extensions with: '--with-cppflags=-I/usr/local/opt/openssl/include'
This could take a while...
Successfully installed eventmachine-1.0.7
1 gem installed
$ brew info openssl
Warning: Although Homebrew has added initial recognition of 10.11, it is unsupported.
You may encounter breakage or other failure and there is no guarantee
Homebrew can resolve those issues until El Capitan is stable.

openssl: stable 1.0.2c
OpenSSL SSL/TLS cryptography library
https://openssl.org

This formula is keg-only.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

/usr/local/Cellar/openssl/1.0.2a-1 (463 files, 17M)
  Built from source
/usr/local/Cellar/openssl/1.0.2c (463 files, 17M)
  Built from source
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/openssl.rb
==> Dependencies
Build: makedepend โœ”
==> Options
--universal
    Build a universal binary
--without-check
    Skip build-time tests (not recommended)
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash
@firedev firedev closed this Jun 15, 2015
@firedev firedev referenced this issue in Homebrew/legacy-homebrew Jun 15, 2015
Closed

Proposal: Brew info to display post-install information #40724

@sodabrew
Contributor

Did Apple actually remove OpenSSL libraries from El Capitan?

@routelastresort

@sodabrew Re: OpenSSL -> Secure Transport for libevent2

1.0.7 working for me, per @firedev's reminder, thanks!

@nacengineer

For those that are using bundler this page may help

http://railsguides.net/passing-build-options-to-bundler/

@vassilevsky

Another way of letting the compiler know about the non-standard OpenSSL include directory is running:

bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include

Then the next bundle install works fine.

@matthewbarram

gem install eventmachine -v '1.0.4' -- --with-cppflags=-I/usr/local/opt/openssl/include worked for me too.

@bobintornado

Love this quick solution.
gem install eventmachine -v '1.0.7' -- --with-cppflags=-I/usr/local/opt/openssl/include
worked for me too.

@jwg2s
jwg2s commented Oct 21, 2015

gem install eventmachine -v '1.0.8' -- --with-cppflags=-I/usr/local/opt/openssl/include worked for me as well with El Capitan

@KehindeAyanleye

gem install eventmachine -v '1.0.5' -- --with-cppflags=-I/usr/local/opt/openssl/include worked for me with El Captain ๐Ÿ’จ

@orien
orien commented Oct 22, 2015

Shouldn't we also link against the homebrew installed library?

--with-cppflags="-I$(brew --prefix openssl)/include" --with-ldflags="-L$(brew --prefix openssl)/lib"
@bobintornado

@orien yes I believed that's a good idea. Considering the fact that Apple has already deprecated OpenSSL.

@va3093
va3093 commented Oct 26, 2015

gem install eventmachine -v '1.0.4' -- --with-cppflags=-I/usr/local/opt/openssl/include worked for me as well.

@romeroabelleira

With openssl installed using Homebrew you can brew link openssl --force and then gem install will find the libs.

@sodabrew
Contributor

@orlen You are correct to also link against the openssl libraries that match the header files.

I don't think we're doing anything unusual with data data structures or constants that might change between versions of OpenSSL, but header files do change sometimes and using mis-matching headers and libraries has a potential to be a problem.

@tinogomes

โค๏ธ

@itsNikolay

@KehindeAyanleye
I approve it works on El Captain. Tthanks. ๐Ÿ‘

@cjjuice
cjjuice commented Nov 4, 2015

๐Ÿ‘

@mattleonard

@vassilevsky - You the real MVP. Fixed my install issue with bundle!

@timurvafin timurvafin added a commit to fs/osx-bootstrap that referenced this issue Nov 16, 2015
@timurvafin timurvafin Link openssl formalue to /usr/local
To let other software to find keg-only openssl headers we link them
to /usr/local

Without that gems like eventmachine will not build at all.
eventmachine/eventmachine#602 (comment)
eb99547
@skunkworker

brew link openssl --force fixed my issue completely. I'm on 10.11.1 with ruby 2.2.3.
Thanks for the fix.

@CedricLor CedricLor referenced this issue in locomotivecms/engine Nov 19, 2015
Closed

Installing the gem on El Capitan #1080

@sirajudheenam

gem install eventmachine -v '1.0.8' -- --with-cppflags=-I/usr/local/opt/openssl/include
worked for me. Thanks.

@mattheworiordan

brew link openssl --force fixed my issue completely. I'm on 10.11.1 with ruby 2.2.3.

Worked for me too, thanks ๐Ÿ‘

@sj26
sj26 commented Dec 7, 2015

Since El Capitan removed openssl headers but left openssl.pc pkgconfig in the default package config path, but eventmachine defers to pkgconfig over --with-ssl-dir, a nice way to do this now with openssl installed with homebrew is:

$ PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" gem install eventmachine
Building native extensions.  This could take a while...
Successfully installed eventmachine-1.0.8
1 gem installed
@parkerl
parkerl commented Dec 7, 2015

๐Ÿ‘ Thank you!

@sodabrew
Contributor
sodabrew commented Dec 7, 2015

@sj26 That's a nice approach. Let's discuss in #661. I am going to lock this issue now.

@sodabrew sodabrew locked and limited conversation to collaborators Dec 7, 2015
@sodabrew
Contributor

Please try eventmachine-1.0.9, it should compile and install without error on El Capitan. Discuss issues on #668.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.