gem eventmachine fatal error: 'openssl/ssl.h' file not found gem eventmachine fatal error: 'openssl/ssl.h' file not found ruby ruby

gem eventmachine fatal error: 'openssl/ssl.h' file not found


$ 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.81 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


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)