How to Install Older Ruby Versions on macOS Ventura
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 macOS Ventura. 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. 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.
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. For example, some people have had trouble installing Ruby 2.4.x with rbenv
. I personally recommend ruby-install because it’s the most reliable. It’s what Ruby on Mac uses to make it super easy to install any version of Ruby (although Ruby on Mac’s special sauce is that it uses a custom version of ruby-install).
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 older than 2.4 that need OpenSSL 1.0. 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
- How to install older Ruby versions (2.4.x and newer) on macOS
- Install older Ruby versions on macOS with Docker
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. 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 2.1) is as easy as running this command:
rom install ruby 2.3.8
How to install older Ruby versions (2.4.x and newer) on macOS
If you have an Intel Mac
-
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 asruby-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. -
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 or M2 chip
You’ll need to run Terminal with Rosetta and reinstall all dev tools over again, including Homebrew. To run Terminal with Rosetta, follow these steps:
-
Quit Terminal if it’s running
-
Go to the Finder
-
Go to the Utilities folder by pressing shift-command-U (or select “Go” from the menu bar, then select Utilities)
-
Click once on the Terminal app to select it, but don’t launch it.
-
Press the ⌘-i keyboard shortcut to open the Info window (or from the menu bar: “File”, then “Get Info”).
-
Check the checkbox that says “Open using Rosetta”
-
Close the Terminal Info window
-
Launch Terminal
-
Run
arch
. It should sayi386
-
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 asruby-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. -
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.
Note that if you had previously installed dev tools and worked on Ruby projects without Rosetta, going back and forth between old and new projects can cause issues. Ruby on Mac configures things for you to prevent most of those issues.
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.