A workaround for developers who cannot build Ruby from source code on their machine.
brew install ruby@<version>
ln -s $(brew --prefix ruby@<version>) ~/.rbenv/versions/<version>For exmaple
brew install [email protected]
ln -s $(brew --prefix [email protected]) ~/.rbenv/versions/3.1Caveats:
- Homebrew always install the latest patch version of a given Ruby version. If your
.ruby-versionlocks at the patch version (e.g.3.1.2), change it to minor version (3.1) or change the symlink to3.1.2. - Homebrew does not distribute dead versions of Ruby, such as
2.3at the time of this writing. If you must use it, try build from tarball,ruby-build,ruby-installorrvm. Alternatively, try using a Docker container for development with RubyMine.