How to Install Older Ruby Versions on macOS Ventura and Sonoma

Published by Moncef Belyamani on
Updated on

If you’re trying to run an old Rails app, Jekyll site, or other Ruby project that uses an older version of Ruby (2.6 or older), then I recommend installing a newer version of Ruby on your Mac, then update your Rails app to use that newer version. If that’s feasible, I wrote a detailed step-by-step guide that goes over How and Why to Upgrade the Ruby Version in Your Project.

However, it’s understandable that you might want to get your old Ruby project running with the older Ruby version first, and then update it little by little to newer versions of Ruby and Rails/Jekyll. In that case, it’s definitely possible to install older Ruby versions on any macOS version that’s currently supported: Sonoma (macOS 14.x), Ventura (macOS 13.x), and the latest version of Monterey (macOS 12.6.x). For Ruby versions 2.4 and newer, it’s much easier than versions 2.3.8 and older.

That’s because Ruby 2.4 and newer work with OpenSSL 1.1, which is still available with Homebrew. Ruby 3.1 and newer support OpenSSL 3.x. However, Ruby versions 2.3.8 and older require OpenSSL 1.0, which you can’t install with Homebrew anymore. So you have to manually download it from the OpenSSL site, then configure and compile it yourself. Then tell the Ruby installer where to find OpenSSL 1.0.

Also note that OpenSSL 1.1 reached end of life on September 11, 2023. This means that soon, you won’t be able to install it with Homebrew, so Ruby versions between and including 2.4 and 3.0 will become harder to install as well.

Another thing to keep in mind is that there are several Ruby version managers, and they don’t all work the same. They all have different pros and cons. Some version managers handle certain scenarios better than others, and some have better default settings than others.

In the rest of the article, I go over various ways to install older Ruby versions on macOS. If you value your time and prefer to pay to have everything set up for you, then you can skip the manual step-by-step guides and buy Ruby on Mac Ultimate, which automates the whole process for you in minutes, including Ruby versions as old as 1.9.3 on Monterey and Ventura, and as old as 2.3.x on Sonoma. It also installs Ruby 3 times faster than the method used in the guides linked below, and twice as fast as rbenv or asdf! That’s 2 minutes saved per Ruby installation!

Install older Ruby versions in minutes with Ruby on Mac

If you don’t feel like spending time setting everything up manually, you can be up and running with older and newer versions of Ruby in minutes with Ruby on Mac.

Note that only the “Ultimate” version of Ruby on Mac supports older Ruby versions. For a limited time, it also includes a free 30-minute consultation (worth $150 on its own) if you need further help updating your old Ruby project.

With Ruby on Mac Ultimate, installing any version of Ruby (as old as 1.9.3) is as easy as running a command like this one:

rom install ruby 2.3.8

Note that the oldest version of Ruby you can install on macOS Sonoma is 2.3.x

How to install older Ruby versions (2.4.x and newer) on macOS

If you have an Intel Mac

  1. Follow my step-by-step guide for installing Ruby on macOS with ruby-install, but replace ruby-install ruby with the latest patch version of the older Ruby version you need, such as ruby-install 2.4.10. As I explain in my article about upgrading your Ruby version, you always want to use the latest patch version for any given Ruby version. The patch version is the 3rd digit. For example, if you have a Rails app that’s using 2.4.4, you want to use the latest possible version in the 2.4.x series, which is 2.4.10. Examples of latest versions are: 2.1.10, 2.2.10, 2.3.8, 2.4.10, 2.5.9, and 2.6.10. endoflife.date is a great site for looking up the latest versions of all kinds of programming languages and frameworks.

  2. If your old Ruby project was not already using the latest patch version (3rd digit of the Ruby version), then follow my guide for upgrading your Ruby version to update your project from the old patch version to the latest one.

If you have an Apple Silicon Mac with the M1, M2, or M3 chip

You’ll need to run Terminal with Rosetta and reinstall all dev tools over again, including Homebrew. I only recommend this option if you know what you’re doing. Installing things in both native mode (without Rosetta) and with Rosetta, and switching back and forth can cause all kinds of issues.

If you need to install old Ruby versions, you’re most likely doing this for your job, so I highly recommend asking your manager to buy Ruby on Mac Ultimate for you, to avoid messing up your dev setup. Ruby on Mac Ultimate properly configures Rosetta for you.

To run Terminal with Rosetta, follow these steps:

  1. Quit Terminal if it’s running

  2. Go to the Finder

  3. Go to the Utilities folder by pressing shift-command-U (or select “Go” from the menu bar, then select Utilities)

  4. Click once on the Terminal app to select it, but don’t launch it.

  5. Press the ⌘-i keyboard shortcut to open the Info window (or from the menu bar: “File”, then “Get Info”).

  6. Check the checkbox that says “Open using Rosetta”

  7. Close the Terminal Info window

  8. Launch Terminal

  9. Run arch. It should say i386

  10. Follow my step-by-step guide for installing Ruby on macOS with ruby-install, but replace ruby-install ruby with the latest patch version of the older Ruby version you need, such as ruby-install 2.4.10. As I explain in my article about upgrading your Ruby version, you always want to use the latest patch version for any given Ruby version. The patch version is the 3rd digit. For example, if you have a Rails app that’s using 2.4.4, you want to use the latest possible version in the 2.4.x series, which is 2.4.10. Examples of latest versions are: 2.1.10, 2.2.10, 2.3.8, 2.4.10, 2.5.9, and 2.6.10.

  11. If your old Ruby project was not already using the latest patch version (3rd digit of the Ruby version), then follow my guide for upgrading your Ruby version to update your project from the old patch version to the latest one.

Install older Ruby versions on macOS with Docker

Although I’ve used Docker, it was mainly to run services like Postgres and Redis. Being an expert on setting up Ruby on a Mac, I’ve never had the need to use Docker to run Ruby. All this is to say that I don’t have a detailed Docker tutorial, but I know there are plenty out there that show how to set up Docker for a Rails app.

Keep in mind that a common complaint with Docker is that the dev workflow is slower due to the lag it introduces, and if you’re not a Docker expert, troubleshooting issues can be time-consuming and frustrating. Also, by default, Docker uses 2GB of your Mac’s memory.