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

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

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

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

firedev opened this issue Jun 12, 2015 · 26 comments

Comments

@firedev
Copy link

@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 Can't reinstall on OS X 10.11 El Capitan, ruby 2.1.2, openssl 1.0.2a-1 Can't reinstall on OS X with openssl 1.0.2a-1 Jun 12, 2015
@ariperez
Copy link

@ariperez 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
Copy link
Author

@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
@sodabrew
Copy link
Contributor

@sodabrew sodabrew commented Jun 15, 2015

Did Apple actually remove OpenSSL libraries from El Capitan?

@routelastresort
Copy link

@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
Copy link

@nacengineer nacengineer commented Oct 8, 2015

For those that are using bundler this page may help

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

@vassilevsky
Copy link

@vassilevsky 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
Copy link

@matthewbarram 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
Copy link

@bobintornado 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
Copy link

@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
Copy link

@KehindeAyanleye 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
Copy link

@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
Copy link

@bobintornado bobintornado commented Oct 22, 2015

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

@va3093
Copy link

@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
Copy link

@romeroabelleira 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
Copy link
Contributor

@sodabrew 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
Copy link

@tinogomes tinogomes commented Oct 30, 2015

❤️

@itsNikolay
Copy link

@itsNikolay itsNikolay commented Nov 1, 2015

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

@cjjuice
Copy link

@cjjuice cjjuice commented Nov 4, 2015

👍

@mattleonard
Copy link

@mattleonard 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
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
Copy link

@skunkworker 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
Copy link

@sirajudheenam 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
Copy link

@mattheworiordan 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
Copy link

@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
Copy link

@parkerl parkerl commented Dec 7, 2015

👍 Thank you!

@sodabrew
Copy link
Contributor

@sodabrew 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
Copy link
Contributor

@sodabrew 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.