Running a Startup on AWS? Get Funding With AWS JumpStart. Click Here to Learn More

2021 Fillmore Street #1128

}

24/7 solutions

Top 10 Cloud Providers

Ruby OpenSSL Not Found on Catalina MacOS

Joel Garcia Joel Garcia has been building AllCode since 2015. He’s an innovative, hands-on executive with a proven record of designing, developing, and operating Software-as-a-Service (SaaS), mobile, and desktop solutions. Joel has expertise in HealthTech, VoIP, and cloud-based solutions. Joel has experience scaling multiple start-ups for successful exits to IMS Health and Golden Gate Capital, […]

After upgrading to Catalina on my Mac, I realized that I was unable to install a new version of Ruby using RVM without encountering OpenSSL errors. This turned into a full fledged nightmare for a couple of clients’ source code who leverage old versions of Ruby.

If you’ve encountered issues with RVM, Ruby, Mac OSX, OpenSSL, nokogiri, V8, and therubyracer, and you only want to see the solution, click here.

This article assumes that you know to avoid using the version of Ruby bundled with Mac OS X. Instead, you should install your own version of Ruby with RVM, the Ruby Version Manager.

Prior versions of MacOS provided openssl-0.9.8 until the High Sierra release. Now, in MacOS 10.15.2, it’s LibreSSL. I have no idea why MacOS changed from OpenSSL to LibreSSL.
To see what eversion of OpenSSL is on your Mac, type the following command:

$ openssl version -a
LibreSSL 2.8.3

To install the latest version of ruby-2.3.4, I take the following steps from the terminal prompt

$ rvm get master
$ rvm cleanup all
$ rvm install ruby-2.3.4
$ rvm use ruby-2.3.4
$ cd {app_folder}
$ bundle install

First, I encountered problems installing nokogiri-1.8.4. The error logs stated.

conftest.c:3:10: fatal error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.

After googling around, I uncovered that building nokogiri with the system libraries might be beneficial

gem install nokogiri -- --use-system-libraries=true --with-xml2-include="$(xcrun --show-sdk-path)"/usr/include/libxml2

I then ran into issues with OpenSSL that prompted me to try

$ rvm pkg install openssl

The install openssl command failed with .rvm/log/1594962591/openssl_make.install.log,

/bin/sh: /Users/joelgarcia/.rvm/usr/ssl/man/man3/hmac.3: Too many levels of symbolic links

One blog post recommended that I remove the /.rvm/usr/ssl/man with rm -rf and try to run bundle install again to no avail.
Next, I searched online and found an article that recommended specifying the system OpenSSL libraries during the ruby installation to make use of the system openSSL.
I removed ruby-2.3.4 using

rvm remove ruby-2.3.4

I installed ruby-2.3.4 using

rvm install ruby-2.3.4 --with-openssl-dir='/usr/local/opt/openssl'

This looked promising until I started encountering problems with v8 and therubyracer. My gem install for therubyracer would always fail here, v$HOME/.rvm/rubies/ruby-2.3.4/lib/ruby/gems/2.3.4/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/mkmf.log, with an openSSL error.
Some more googling led me to the following link with the following code:

brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install


Even after running this code, the bundle install would eventually fail with the inability to load openSSL.
Finally, I stumbled across the idea to install an older version of OpenSSL and to have the rvm install point to this older version of OpenSSL. Believe it or not this actually worked.
I installed the older version of OpenSSL with a tab by rbenv.

brew install rbenv/tap/[email protected]

Then I reinstalled ruby version referencing the old version of openssl. Success.

rvm reinstall 2.3.0 --with-openssl-dir='/usr/local/opt/[email protected]'
Joel Garcia
Joel Garcia

Joel Garcia has been building AllCode since 2015. He’s an innovative, hands-on executive with a proven record of designing, developing, and operating Software-as-a-Service (SaaS), mobile, and desktop solutions. Joel has expertise in HealthTech, VoIP, and cloud-based solutions. Joel has experience scaling multiple start-ups for successful exits to IMS Health and Golden Gate Capital, as well as working at mature, industry-leading software companies. He’s held executive engineering positions in San Francisco at TidalWave, LittleCast, Self Health Network, LiveVox acquired by Golden Gate Capital, and Med-Vantage acquired by IMS Health.

Related Articles

Here’s Why You Should Work with an AWS Partner

Here’s Why You Should Work with an AWS Partner

Amazon Web Services is understandably a difficult platform to adapt to and utilize fully upon first getting started. Some organizations can be selected to become certified partners to indirectly extend services to help build on the Amazon Cloud. Finding a certified company to help build out is undoubtedly the best way to significantly simplify, streamline, and reduce the cost of utilizing AWS.

Amazon Web Services – CodeCatalyst

Amazon Web Services – CodeCatalyst

When a development team is building out an application, it helps to have access to the same resources, have the tools for planning and testing, and to have access to the application all in one place. CodeCatalyst comes with a slew of continuous integration/continuous development (CI/CD) tools and can leverage other AWS services and be connected to other AWS projects on an account. As a collaborative tool, it is easy to introduce new members into the project and to log all activity or all tests from a single dashboard. It’s a complete package of all the tools needed to securely work on every step of an application’s lifecycle.

The Definitive Guide to AWS Pricing

The Definitive Guide to AWS Pricing

Perhaps the biggest issue with AWS that its competitors edge out on is the confusing pricing model. It does promise the capacity to help users save significantly on funds that otherwise by avoiding spending on unnecessary resources, but getting to that point isn’t always clear. We will be covering in greater detail how this works.

Download our 10-Step Cloud Migration ChecklistYou'll get direct access to our full-length guide on Google Docs. From here, you will be able to make a copy, download the content, and share it with your team.