Install gem eventmachine 1.2.7 with ssl on m1

Viewed 1027

I'm posting this in case anyone else has the same issue. I was trying to deploy my ruby project from and apple m1 laptop and was getting libc++abi: terminating with uncaught exception of type std::runtime_error: Encryption not available on this event-machine .

Checking eventmachine gave

ruby -reventmachine -ve "puts EM.library_type, EM.ssl?"                     
ruby 2.6.7p197 (2021-04-05 revision 67941) [arm64-darwin20]
extension
false

Tried an uninstall and install on eventmachine to no avail.

2 Answers

@Chrissy H answer did not work on my M1 Mac, but the following did (by recompiling native extensions)

PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" \
   gem install eventmachine 

Note that I' musing openssl v1 and needed a specific version, maybe that is why, anyway my full command was:

PKG_CONFIG_PATH="$(brew --prefix openssl@1.0)/lib/pkgconfig" \ 
   gem install eventmachine -v '1.0.9.1'

Searched for where openssl was installed and then uninstalled and reinstalled with

gem install eventmachine -v '1.2.7' -- --with-cppflags=-I/Users/chris/.rbenv/versions/2.6.7/openssl/include

Then had

ruby -reventmachine -ve "puts EM.library_type, EM.ssl?"                                                    
ruby 2.6.7p197 (2021-04-05 revision 67941) [arm64-darwin20]
extension
true
Related