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

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

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

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 comment has been minimized.

Show comment
Hide comment
@ariperez

ariperez Jun 15, 2015

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.

ariperez commented Jun 15, 2015

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

This comment has been minimized.

Show comment
Hide comment
@firedev

firedev 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 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
@sodabrew

This comment has been minimized.

Show comment
Hide comment
@sodabrew

sodabrew Jun 15, 2015

Contributor

Did Apple actually remove OpenSSL libraries from El Capitan?

Contributor

sodabrew commented Jun 15, 2015

Did Apple actually remove OpenSSL libraries from El Capitan?

@routelastresort

This comment has been minimized.

Show comment
Hide comment
@routelastresort

routelastresort commented Aug 9, 2015

@sodabrew Re: OpenSSL -> Secure Transport for libevent2

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

@nacengineer

This comment has been minimized.

Show comment
Hide comment
@nacengineer

nacengineer Oct 8, 2015

For those that are using bundler this page may help

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

nacengineer commented Oct 8, 2015

For those that are using bundler this page may help

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

@vassilevsky

This comment has been minimized.

Show comment
Hide comment
@vassilevsky

vassilevsky Oct 14, 2015

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.

vassilevsky commented Oct 14, 2015

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

This comment has been minimized.

Show comment
Hide comment
@matthewbarram

matthewbarram Oct 19, 2015

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

matthewbarram commented Oct 19, 2015

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

@bobintornado

This comment has been minimized.

Show comment
Hide comment
@bobintornado

bobintornado Oct 21, 2015

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

bobintornado commented Oct 21, 2015

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

@jwg2s

This comment has been minimized.

Show comment
Hide comment
@jwg2s

jwg2s 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

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

This comment has been minimized.

Show comment
Hide comment
@KehindeAyanleye

KehindeAyanleye Oct 22, 2015

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

KehindeAyanleye commented Oct 22, 2015

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

@orien

This comment has been minimized.

Show comment
Hide comment
@orien

orien 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"

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

This comment has been minimized.

Show comment
Hide comment
@bobintornado

bobintornado Oct 22, 2015

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

bobintornado commented Oct 22, 2015

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

@va3093

This comment has been minimized.

Show comment
Hide comment
@va3093

va3093 Oct 26, 2015

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

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

This comment has been minimized.

Show comment
Hide comment
@romeroabelleira

romeroabelleira Oct 29, 2015

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

romeroabelleira commented Oct 29, 2015

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

@sodabrew

This comment has been minimized.

Show comment
Hide comment
@sodabrew

sodabrew Oct 29, 2015

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.

Contributor

sodabrew commented Oct 29, 2015

@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

This comment has been minimized.

Show comment
Hide comment
@tinogomes

tinogomes commented Oct 30, 2015

❤️

@itsNikolay

This comment has been minimized.

Show comment
Hide comment
@itsNikolay

itsNikolay Nov 1, 2015

@KehindeAyanleye
I approve it works on El Captain. Tthanks. 👍

itsNikolay commented Nov 1, 2015

@KehindeAyanleye
I approve it works on El Captain. Tthanks. 👍

@cjjuice

This comment has been minimized.

Show comment
Hide comment
@cjjuice

cjjuice commented Nov 4, 2015

👍

@mattleonard

This comment has been minimized.

Show comment
Hide comment
@mattleonard

mattleonard Nov 5, 2015

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

mattleonard commented Nov 5, 2015

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

timurvafin added a commit to fs/osx-bootstrap that referenced this issue Nov 16, 2015

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)
@skunkworker

This comment has been minimized.

Show comment
Hide comment
@skunkworker

skunkworker Nov 16, 2015

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

skunkworker commented Nov 16, 2015

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

@sirajudheenam

This comment has been minimized.

Show comment
Hide comment
@sirajudheenam

sirajudheenam Nov 27, 2015

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

sirajudheenam commented Nov 27, 2015

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

@mattheworiordan

This comment has been minimized.

Show comment
Hide comment
@mattheworiordan

mattheworiordan Nov 29, 2015

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

Worked for me too, thanks 👍

mattheworiordan commented Nov 29, 2015

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

This comment has been minimized.

Show comment
Hide comment
@sj26

sj26 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

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

This comment has been minimized.

Show comment
Hide comment
@parkerl

parkerl Dec 7, 2015

👍 Thank you!

parkerl commented Dec 7, 2015

👍 Thank you!

@sodabrew

This comment has been minimized.

Show comment
Hide comment
@sodabrew

sodabrew Dec 7, 2015

Contributor

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

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.

@eventmachine eventmachine locked and limited conversation to collaborators Dec 7, 2015

@sodabrew

This comment has been minimized.

Show comment
Hide comment
@sodabrew

sodabrew Jan 13, 2016

Contributor

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

Contributor

sodabrew commented Jan 13, 2016

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.