Open janko opened 7 years ago
I only get that on my local Mac OS computer, it's not happening on Ubuntu.
@janko-m Does openssl/conf.h
exist anywhere on your machine (being a search path issue for this gem) or do openssl headers just need to be installed for you?
@jemc I do have OpenSSL installed and have the header file in /usr/local/Cellar/openssl/1.0.2l/include/openssl/conf.h
(via Homebrew).
I saw that people had problems installing EventMachine, and that doing gem install eventmachine -- --with-cppflags=-I/usr/local/Cellar/openssl/1.0.2l/include
would solve the issue, so I'm searching now the equivalent for C code (EventMachine has C++). I was able to normally install EventMachine, so I'm surprised that a gem with C extensions instead of C++ cannot find OpenSSL.
Ok, I found how do it with Puma in https://github.com/puma/puma/issues/718#issuecomment-122632128, so I tried the same thing with rabbitmq
:
$ gem install rabbitmq -- --with-opt-include=/usr/local/opt/openssl/include
But I still get the same error 😕. I checked that /usr/local/opt/openssl/include/openssl/conf.h
exists.
so I'm surprised that a gem with C extensions instead of C++ cannot find OpenSSL.
Well, the thing is that this gem doesn't actually have a C extension - it just uses the Rakefile hook to build the shared library, then links to that via FFI. That is, it uses a C library, but it doesn't build a C extension onto Ruby itself.
I think it might work to use the env vars recognized by C compilers.
What happens if you run env C_INCLUDE_PATH=/usr/local/opt/openssl/include gem install rabbitmq
?
@jemc That works! Thank you for the help!
I get the following error when I try to
gem install rabbitmq
on MRI 2.3 or 2.4:Here is the full error log: https://gist.github.com/janko-m/2ae7441b0610f01baddbcdb00709c930