Caius Theory

Now with even more cowbell…

`asdf install ruby` on macOS

Installing ruby through asdf on Apple Silicon Macs1 will attempt to build a custom openssl for each install because it can’t find openssl from homebrew in /usr/local, as that’s now installed in /opt/homebrew. This means your brew update no longer pulls in security fixes for your ruby runtimes, as well as wasting disk space.

Ruby 2.6.10 & 2.7.x need OpenSSL 1.1, and are unsupported at time of publishing so you should really upgrade to ruby 3! (Tested with ruby 2.6.10 and 2.7.8 at time of publishing.)

brew install openssl@1.1
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)" \
  asdf install ruby 2.7.8

Ruby 3.0 and higher need openssl@3 so we follow the same override but with a different brew name. (Tested with ruby 3.1.4 and 3.2.2 at time of publishing.)

brew install openssl@3
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@3)" \
  asdf install ruby 3.2.2

Also if you’re trying to install a version of ruby that exists in rbenv/ruby-build master branch, but not in the version of ruby-build asdf-ruby plugin uses you can override it with ASDF_RUBY_BUILD_VERSION=master when running asdf ruby install x.y.z. Pass as an extra envariable to the above commands.

  1. M1/M2 processors ↩︎