How to update Ruby with Homebrew?

Ralph David Abernathy picture Ralph David Abernathy · Apr 7, 2016 · Viewed 101.3k times · Source

I want to know how to update to the latest stable version of Ruby with Homebrew. I am not interested in using RVM. Thanks.

Answer

spickermann picture spickermann · Apr 7, 2016

I would use ruby-build with rbenv. The following lines install Ruby 2.7.2 and set it as your default Ruby version:

$ brew update
$ brew install ruby-build
$ brew install rbenv

$ rbenv install 2.7.2
$ rbenv global 2.7.2