gem eventmachine fatal error: 'openssl/ssl.h' file not found
brew link --force openssl
Then:
gem install eventmachine
It also fixes:
- gem install taks
- bundle install
- rake and rails tasks
P.S. Probably you'll need to remove and run brew install openssl
again
The issue happends because Apple had removed openssl from OSX (in El Captain build)
gem pristine eventmachine -- --with-cppflags=-I/usr/local/opt/openssl/include
pristine removes the old gem and recompiles it.
The cpp flags option allows the compiler to find the openssl headers.
If you prefer to abstract away the cpp flags argument, you can do the following:
PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig"
You can also add the version if you like:
gem pristine eventmachine -v '1.0.4' -- --with-cppflags=-I/usr/local/opt/openssl/include
$ gem install eventmachine -- --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.8
1 gem installed
You can also set up bundler like this but I think that is superficial
bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include
When using bundler and homebrew:
$ bundle config build.eventmachine --with-cppflags=-I$(brew --prefix openssl)/include
$ bundle install