3

I am attempting to locally host a Jekyll site on Mac OS. Upon downloading Jekyll with gem install jekyll I am met with error:

current directory: /Users/main/.rvm/gems/ruby-3.0.0/gems/eventmachine-1.2.7/ext
make DESTDIR\= sitearchdir\=./.gem.20221106-46436-a98sx9 sitelibdir\=./.gem.20221106-46436-a98sx9
compiling binder.cpp
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

I am on MacOS Ventura 13.0.

  • openssl version returns LibreSSL 3.3.6

  • jekyll -v returns can't find gem jekyll (>= 0.a) with executable jekyll (Gem::GemNotFoundException) (obviously)

  • ruby -v returns ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin22]

  • gem -v returns 3.3.25

  • bundle -v returns Bundler version 2.3.25

  • rvm list returns =* ruby-3.0.0 [ x86_64 ]

  • gem list returns

rubygems-bundler (1.4.5)
rubygems-update (3.3.25, 3.0.0)
rvm (1.11.3.9)

... among other things. No Ruby version is listed.

I have attempted brew link --force openssl, so that I can run gem install event machine (with flags), but brew link --force openssl returns

If you need to have openssl@3 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> ~/.zshrc

I ran that command, re-ran brew link --force openssl, and it returned the same error.

What do I do? Thank you for any help.

1 Answers1

5

I had similar eventmachine issues on M1 Macs installing Jekyll. While this is inspired by Stackoverflow running brew link --force openssl did NOT solve my issues.

I could solve these Openssl issues as follows:

  1. Run brew --prefix openssl to check the openSSL path. If OpenSSL is not installed, install it first.
  2. Run bundle config build.eventmachine --with-openssl-dir=$(brew --prefix openssl).
  3. Run bundle config build.eventmachine --with-cppflags=-I$(brew --prefix openssl)/include.
  4. Run bundle

See also this GitHub discussion, have you tried to run brew list openssl to see if you have different openSSL versions installed?

Christian
  • 4,902
  • 4
  • 24
  • 42
  • I would like to note that upon installing Homebrew, I am not met with the "next steps" and the two commands I see others met with to add Homebrew to path. After following all of your steps, I attempted the first command that others get after installing Homebrew, `echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/main/.zprofile` and nothing was returned. I attempted the second command other users are told to do by console, `eval "$(/opt/homebrew/bin/brew shellenv)"`, and `zsh: no such file or directory: /opt/homebrew/bin/brew` is returned. – bdeweesevans Nov 08 '22 at 07:22
  • Please run the commands above and updated your post with the full bundle install output. Thanks. – Christian Nov 09 '22 at 02:16
  • 1
    I reset my mac and decided to do my work inside a Docker container. Although it isn't the perfect solution to my problem, it is a perfectly fine work around. I followed this video by Bill Raymond and all works perfectly and as it should: https://www.youtube.com/watch?v=owHfKAbJ6_M – bdeweesevans Nov 09 '22 at 08:42