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.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
Can't install middleman due to gem install failure
It looks like it's an issue with El Capitan not providing openSSL headers.
https://github.com/eventmachine/eventmachine/issues/643
The solution is to install openssl using Homebrew or MacPorts brew install openssl
I had to do brew link openssl --force
as openSSL was already installed
Error 'openssl/crypto.h' file not found when installing PycURL on Mac using pip
What eventually helped was:
- Remove
pycurl
from therequirements.txt
file - Install
openssl
with:brew install openssl
- Find
openssl
installation directory with
$ brew --prefix openssl
/usr/local/opt/openssl@3
$ ls -la /usr/local/opt/openssl@3
lrwxr-xr-x 1 runner admin 25 Jul 6 09:13 /usr/local/opt/openssl@3 -> ../Cellar/openssl@3/3.0.4
- Install PycURL specifying inline the above
openssl
install directories like this:
PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/usr/local/Cellar/openssl@3/3.0.4/lib" CPPFLAGS="-I/usr/local/Cellar/openssl@3/3.0.4/include" pip3 install --no-cache-dir pycurl
- Now the PycURL installs without any problem:
Collecting pycurl
Downloading pycurl-7.45.1.tar.gz (233 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 233.9/233.9 kB 64.5 MB/s eta 0:00:00
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: pycurl
Building wheel for pycurl (setup.py): started
Building wheel for pycurl (setup.py): finished with status 'done'
Created wheel for pycurl: filename=pycurl-7.45.1-cp39-cp39-macosx_10_15_x86_64.whl size=146607 sha256=aff9581cbd6ddec739c529df376ad2d4edf49dafdad179a9b68bddeb60a739b3
Stored in directory: /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-ephem-wheel-cache-hjqadgim/wheels/4d/ef/77/ffab9dc4b0016ce4f780b752e0020815e416f0d27a701a816f
Successfully built pycurl
Installing collected packages: pycurl
Successfully installed pycurl-7.45.1
fatal error: openssl/ssl.h: No such file or directory
It looks like that the development package for openssl is not installed:
https://stackoverflow.com/a/3016986/5147260
openssl/ssl.h not found but installed with homebrew
I found the solution: clang was not looking in the right place.
xcode-select --install
This post resolved this issue: On mac, g++ (clang) fails to search /usr/local/include and /usr/local/lib by default
Related Topics
Class ≪≪ Self VS Self.Method With Ruby: What's Better
When Do I Need to Restart Server in Rails
Why Not Use Shared Activerecord Connections For Rspec + Selenium
Devise Custom Routes and Login Pages
How to Stub Things in Minitest
How to Run Rake Tasks Within a Ruby Script
In Ruby, Is There an Array Method That Combines 'Select' and 'Map'
Getaddrinfo: Nodename Nor Servname Provided, or Not Known
Rails Each Loop Insert Tag Every 6 Items
Checking If a Variable Is Defined in Sass
How to Convert Datetime.Now to Utc in Ruby
Running a Command from Ruby Displaying and Capturing the Output
Purpose of "Consider_All_Requests_Local" in Config/Environments/Development.Rb
How to Use "Gets" and "Gets.Chomp" in Ruby