Skip to content

Instantly share code, notes, and snippets.

@elyalvarado
Last active September 18, 2020 19:40
Show Gist options
  • Save elyalvarado/aa2e6f077d2d68fbe8ca96e834be354e to your computer and use it in GitHub Desktop.
Save elyalvarado/aa2e6f077d2d68fbe8ca96e834be354e to your computer and use it in GitHub Desktop.
Installing ruby 2.3.x on MacOS X 2020 Edition

Ruby 2.3.x requires the OpenSSL library version 1.0.x, however this version of the library has been deprecated for a while.

If you're using homebrew the library is no longer a Formula since the end of 2019, so you'll need a work-around to be able to install it. As the new openssl formula in homebrew-core is versioned, you can search for the old formula and extract it into any of your existing taps (we'll use homebrew/cask for simplicity, as most people have it installed).

# First extract the last existing version of the openssl unversioned formula into an existing tap
brew extract openssl homebrew/cask

# Then install the extracted formula
brew install [email protected]

After that you'll able to compile ruby 2.3.x by passing the path of the OpenSSL 1.0.2t library to the compiler (or to RVM as in the following example)

rvm reinstall --disable-binary ruby-2.3.7  --with-openssl-dir="/usr/local/opt/[email protected]"

⚠️⚠️⚠️ Important Note ⚠️⚠️⚠️

There is a reason why OpenSSL v1.0 is no longer in use, and as a general rule you should never install deprecated cryptography libraries. However, if you're working with legacy software and you can't update the dependencies to a newer version, now you know how to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment