Home macOS openssl file not found while installing Ruby gems
Post
Cancel

macOS openssl file not found while installing Ruby gems

While installing Ruby gems on macOS, you might encounter an error like:

1
2
3
4
5
6
7
8
9
10
In file included from binder.cpp:20:
./project.h:119: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

Gem files will remain installed in /Users/burak/.rvm/gems/ruby-3.0.1/gems/eventmachine-1.2.7 for inspection.

That was the case for me when I was trying to install jekyll gem using gem install jekyll.

Solution is to do:

1
gem install jekyll -- --with-cppflags=-I/opt/homebrew/opt/openssl/include
This post is licensed under CC BY 4.0 by the author.