This guide shows how to set up an old Ruby + Rails environment on a modern macOS (Apple Silicon).
As per October 2025, this works on an M1 MacBook Pro (2020) on macOS Sequoia 15.6.1.
As per January 2026, this also works on an M5 MacBook Pro (2025) on macOS Tahoe 26.0.
This is what you’ll end up with:
- Ruby 2.6.10
- OpenSSL 1.1 (needed for Ruby < 3.0)
- MySQL 5.7
Make sure you have Homebrew installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Then install these dependencies via brew:
brew install chruby zlib readline libyaml wget make gccAdd the following to your ~/.zshrc (or ~/.bashrc if using bash):
# chruby setup
source $(brew --prefix chruby)/share/chruby/chruby.sh
source $(brew --prefix chruby)/share/chruby/auto.shReload shell:
source ~/.zshrc3. Install OpenSSL 1.1 and (optionally) MySQL 5.7, as seen on this Gist comment (thank you ferrucc-io!)
Please refer to the above Gist comment if you run into errors with this step.
Install OpenSSL 1.1 (mandatory for Ruby 2.6.10)
brew tap homebrew/core --force
# Restore openssl@1.1 formula from an older commit
sudo curl -fL "https://raw.githubusercontent.com/Homebrew/homebrew-core/6c907880b95a3702348c1fcce1c661fcc03336e5/Formula/o/openssl%401.1.rb" \
-o "/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/o/openssl@1.1.rb"
sudo sed -i '' '/disable! date: "2024-10-24", because: :unsupported/d' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/o/openssl@1.1.rb
# Install OpenSSL 1.1
brew tap-new local/old-openssl
cp /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/o/openssl@1.1.rb \
$(brew --repository local/old-openssl)/Formula/openssl@1.1.rb
brew install local/old-openssl/openssl@1.1Install OpenSSL certs:
For this, make sure OpenSSL 1.1 is installed in /opt/homebrew/opt/openssl@1.1
Check first if /opt/homebrew/etc/openssl@1.1 exists, if so, replace the mkdir -p below with a cd
mkdir -p /opt/homebrew/etc/openssl@1.1
wget https://curl.se/ca/cacert.pem -O /opt/homebrew/etc/openssl@1.1/cert.pem
echo 'export SSL_CERT_FILE=/opt/homebrew/etc/openssl@1.1/cert.pem' >> ~/.zshrc
source ~/.zshrcIf your project depends on MySQL 5.7, you’ll need to re-tap the old formula because it’s been removed from Homebrew. Example steps:
# Restore mysql@5.7 formula from an older commit
sudo curl -fL "https://raw.githubusercontent.com/Homebrew/homebrew-core/6c907880b95a3702348c1fcce1c661fcc03336e5/Formula/m/mysql%405.7.rb" \
-o "/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/m/mysql@5.7.rb"
sudo sed -i '' '/disable! date: "2024-08-01", because: :unsupported/d' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/m/mysql@5.7.rb
# Install MySQL 5.7
brew tap-new local/old-mysql
cp /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/m/mysql@5.7.rb \
$(brew --repository local/old-mysql)/Formula/mysql@5.7.rb
brew install local/old-mysql/mysql@5.7Use ruby-install with these OpenSSL/Zlib/Readline flags:
export OPENSSL_DIR="$(brew --prefix openssl@1.1)"
export CPPFLAGS="-I$OPENSSL_DIR/include"
export LDFLAGS="-L$OPENSSL_DIR/lib"
export PKG_CONFIG_PATH="$OPENSSL_DIR/lib/pkgconfig"
export RUBY_CFLAGS="-Wno-error=deprecated-declarations"
wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.10.tar.gz
tar -xzf ruby-2.6.10.tar.gz
cd ruby-2.6.10
./configure \
--prefix="$HOME/.rubies/ruby-2.6.10" \
--with-openssl-dir="$OPENSSL_DIR" \
--with-readline-dir="$(brew --prefix readline)" \
--with-zlib-dir="$(brew --prefix zlib)" \
--with-libyaml-dir="$(brew --prefix libyaml)"
make clean
make -j$(sysctl -n hw.ncpu)
make install(Installs Ruby into ~/.rubies/ruby-2.6.10)
Run this:
chruby 2.6.10To make this Ruby version the default, add this to ~/.zshrc:
source $(brew --prefix chruby)/share/chruby/chruby.sh
source $(brew --prefix chruby)/share/chruby/auto.sh
chruby ruby-2.6.10Note that the first two lines should probably have been added in a prior step.
Running a legacy version of Ruby means we are likely to run an older Rails version, therefore we need an older version of bundler:
gem install bundler -v 1.17.3Check versions:
ruby -v # ruby 2.6.10p210
bundler -v # Bundler 1.17.3
mysql -V # mysql Ver 14.14 Distrib 5.7.xThat's just about everything.
If OpenSSL is giving you a hard time with installation, compile it from the source.
wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
tar -xvf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config --prefix=/usr/local/opt/openssl@1.1 --openssldir=/usr/local/opt/openssl@1.1 shared zlib
make -j$(sysctl -n hw.ncpu)
make test
sudo make installMake sure to replace brew --prefix openssl@1.1 in the above steps with the directory that OpenSSL 1.1 is installed in, which should be /usr/local/opt/openssl@1.1.
If you decide to do this step, make sure to install the OpenSSL cert and point Ruby to the right path:
sudo mkdir -p /usr/local/etc/openssl@1.1
wget https://curl.se/ca/cacert.pem -O /usr/local/etc/openssl@1.1/cert.pem
echo 'export SSL_CERT_FILE=/usr/local/etc/openssl@1.1/cert.pem' >> ~/.zshrc
source ~/.zshrc
Questions