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

firedev opened this Issue Jun 12, 2015 · 26 comments


None yet
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

$ 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

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:

and then stumbled upon this method for declaring the flag:

Would be interested in knowing the actual fix.

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

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
==> Dependencies
Build: makedepend โœ”
==> Options
    Build a universal binary
    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

and run
@firedev firedev closed this Jun 15, 2015
@firedev firedev referenced this issue in Homebrew/legacy-homebrew Jun 15, 2015

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


Did Apple actually remove OpenSSL libraries from El Capitan?


@sodabrew Re: OpenSSL -> Secure Transport for libevent2

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


For those that are using bundler this page may help


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.


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


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

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


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

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"

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

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.


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


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




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

cjjuice commented Nov 4, 2015



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

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

Installing the gem on El Capitan #1080


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


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 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 commented Dec 7, 2015

๐Ÿ‘ Thank you!

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

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.