Zyzle.dev
;

Installing Ruby with RVM

11th September, 2023

I don’t do much Ruby development these days but it’s often a good idea to do this within a virtual environment using RVM1 when you need an environment of a specific version.

This code will create a dedicated Ruby 3.2 environment to work in:

Currently (11-09-2023) it looks like there is an issue with rvm installing Ruby where paths for Homebrew installed packages are incorrectly recognised, this can be resolved by explicitly adding them to the install command

Terminal window
rvm reinstall 3.2.0 --with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml)

I’ve only tried this myself with v3.2 but it should work with other Ruby versions.

Footnotes

  1. RVM - Ruby Version Manager