Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Failed to build gem native extension. #981

Open
markwyner opened this issue May 9, 2023 · 5 comments
Open

ERROR: Failed to build gem native extension. #981

markwyner opened this issue May 9, 2023 · 5 comments

Comments

@markwyner
Copy link

Hi. I can’t get eventmachine installed. I’ve tried with various options, but nothing gets past the error.

My environment:

  • macOS 13.3.1 (a) (22E772610a)
  • ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin22]
  • rvm 1.29.12 (latest)

I’m trying to run Middleman, but bundle install and bundle update fail because of eventmachine. Also, if I isolate this issue and simply try to install eventmachine without any relationship to Middleman, I still receive an error. gem install eventmachine yields the following:

Building native extensions. This could take a while…
ERROR:  Error installing eventmachine:
	ERROR: Failed to build gem native extension.

    current directory: /Users/markwyner/.rvm/gems/ruby-3.0.0/gems/eventmachine-1.2.7/ext
/Users/markwyner/.rvm/rubies/ruby-3.0.0/bin/ruby -I /Users/markwyner/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0 -r ./siteconf20230509-5730-i6yoqw.rb extconf.rb
checking for -lcrypto… yes
checking for -lssl… yes
checking for openssl/ssl.h… yes
checking for openssl/err.h… yes
checking for rb_trap_immediate in ruby.h,rubysig.h… no
checking for rb_thread_blocking_region()… no
checking for rb_thread_call_without_gvl() in ruby/thread.h… yes
checking for rb_thread_fd_select()… yes
checking for rb_fdset_t in ruby/intern.h… yes
checking for rb_wait_for_single_fd()… yes
checking for rb_enable_interrupt()… no
checking for rb_time_new()… yes
checking for inotify_init() in sys/inotify.h… no
checking for __NR_inotify_init in sys/syscall.h… no
checking for writev() in sys/uio.h… yes
checking for pipe2() in unistd.h… no
checking for accept4() in sys/socket.h… no
checking for SOCK_CLOEXEC in sys/socket.h… no
checking for sys/event.h… yes
checking for sys/queue.h… yes
checking for clock_gettime()… yes
checking for CLOCK_MONOTONIC_RAW in time.h… yes
checking for CLOCK_MONOTONIC in time.h… yes
CXXFLAGS= -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result -Wno-address
creating Makefile

current directory: /Users/markwyner/.rvm/gems/ruby-3.0.0/gems/eventmachine-1.2.7/ext
make “DESTDIR=” clean

current directory: /Users/markwyner/.rvm/gems/ruby-3.0.0/gems/eventmachine-1.2.7/ext
make “DESTDIR=”
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

Gem files will remain installed in /Users/markwyner/.rvm/gems/ruby-3.0.0/gems/eventmachine-1.2.7 for inspection.
Results logged to /Users/markwyner/.rvm/gems/ruby-3.0.0/extensions/x86_64-darwin-22/3.0.0/eventmachine-1.2.7/gem_make.out

Please let me know how you can help. Thank you.

@sodabrew
Copy link
Contributor

project.h:119:10: fatal error: ‘openssl/ssl.h’ file not found
#include <openssl/ssl.h>
^~~~~~~~~~~~~~~
1 error generated.

You'll need install OpenSSL and OpenSSL dev headers.

@supermario
Copy link

supermario commented Jun 19, 2023

@markwyner ran into the same issue today, try this:

brew install openssl@1.1 
# or `brew reinstall openssl@1.1` if you already installed another version
gem install eventmachine -- --with-openssl-dir=$(brew --prefix openssl@1.1)

@bjer
Copy link

bjer commented Aug 23, 2023

On a M2 machine running Ventura 13.5 I had to use openssl@3 from homebrew:

brew install openssl@3
gem install eventmachine -- --with-openssl-dir=$(brew --prefix openssl@3)

@blowfishpro
Copy link

It's odd that it has

checking for openssl/ssl.h… yes

but then

project.h:119:10: fatal error: ‘openssl/ssl.h’ file not found

@blowfishpro
Copy link

this also seems related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants