Error running 'requirements_osx_brew_libs_install libksba openssl@1.1'

Published by Moncef Belyamani on
Updated on

If you just tried installing a Ruby version older than 3.1, such as 3.0.x, with RVM (or another version manager), you probably got an error like the one below. In this post, you’ll not only get helpful solutions, you’ll also understand why this error is happening.

Installing required packages: libksba, openssl@1.1 - please wait
There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://docs.brew.sh/Installation
Error running 'requirements_osx_brew_libs_install libksba openssl@1.1',
please read /Users/moncef/.rvm/log/1731114544_ruby-3.0.7/package_install_libksba_openssl@1.1.log
Requirements installation failed with status: 1.

The reason why RVM is no longer able to install Ruby versions older than 3.1 is because those older versions require OpenSSL 1.1. Here’s a handy OpenSSL and Ruby Compatibility Table. And if you don’t already have OpenSSL 1.1 installed on your Mac, RVM will try to install it for you via Homebrew.

However, Homebrew disabled OpenSSL 1.1 on October 24, 2024 because OpenSSL 1.1 reached end of life in September 2023. Software that is no longer being maintained, and that is no longer getting fixed to address security vulnerabilities, is dangerous to keep using, so it’s perfectly reasonable for Homebrew to disable OpenSSL 1.1, given that they gave people over a year to update their applications.

To make things more complicated, even if you already have OpenSSL 1.1 installed, there is a known issue specifically affecting Ruby 3.0.x on macOS with Xcode/Command Line Tools version 16 or higher. You can check which version you have by running brew config, assuming you’re using Homebrew.

When Apple introduces a new version of the command line tools, it can break other tools like Ruby. In this case, since Ruby 3.0 has reached end of life, it means the Ruby team will no longer update it to fix any incompatibilities.

So what can you do about this?

First, regardless of which Ruby version you’re trying to install, make sure you’re installing the latest patch version (the 3rd digit). There is almost never a good reason to install a version of Ruby that isn’t the latest patch version. For example, instead of trying to install Ruby 3.0.0, you want to install at least 3.0.7, which is the latest in the 3.0.x series. A great site to find the latest versions of each Ruby series (and pretty much every programming language and framework), as well as their current support status, is endoflife.date.

One of the main reasons is that there are often issues with older patch versions that prevent them from installing on macOS. The latest patch versions also have important bug and security fixes.

Given this information, below are 4 options for installing Ruby 3.0.x or newer. The last option is the easiest, fastest, and most reliable, but it’s not free. If you’re the kind of person who would gladly pay to save time and have a tool that just works, you won’t be disappointed.

  • Upgrade your Ruby project to at least Ruby 3.1.7. This will allow you to use OpenSSL 3, and is the right thing to do anyways since Ruby 3.0.x has reached end of life. Here’s a step-by-step guide that shows you How and Why to Upgrade the Ruby Version in Your Project.
  • Use another version manager that installs OpenSSL 1.1 for you, outside of Homebrew. Examples are rbenv and asdf (they both use ruby-build behind the scenes to install Ruby and all the dependencies). One of the downsides is that this slows down the Ruby installation because they compile OpenSSL from scratch each time you install a different Ruby version. Note that you still won’t be able to install Ruby 3.0.x out of the box if you have Xcode/Command Line Tools 16 or higher.
  • If you really need Ruby 3.0.x, and you’ve already upgraded to Sequoia and/or Xcode/Command Line Tools 16, you can downgrade to Xcode/command line tools version 15.3, which you can download on the Apple Developer site. Please note that downgrading could potentially cause other issues, so do it at your own risk.
  • If your main goal is to get your project up and running, and you don’t want to have to think about which OpenSSL version goes with which Ruby version, and all the other factors that can affect Ruby installation, I recommend my Ruby on Mac Ultimate product, which allows you to install Ruby 3.0.x on Sequoia, even with Xcode/command line tools 16+, so that you don’t have to waste time downgrading and worry about what problems that might cause.

Another great aspect of Ruby on Mac is that it works with all the popular version managers: asdf, chruby, frum, rbenv and rvm (mise support is coming later). So, if you have a strong preference for a version manager, or you’re just used to a particular one, you can choose your preferred one, while taking advantage of Ruby on Mac’s more reliable Ruby installation.

I personally recommend chruby (the default in Ruby on Mac) because it’s one of the fastest at switching between Rubies, and is the least likely to cause issues. This is based on my experience helping hundreds of thousands of people with Ruby issues on macOS over the past 12 years.

I hope this helps!