How to update Ruby with Homebrew?
brew upgrade ruby
Should pull latest version of the package and install it.
brew update
updates brew itself, not packages (formulas they call it)
I would use ruby-build
with rbenv
. The following lines install Ruby 3.1.2 and set it as your default Ruby version:
$ brew update
$ brew install ruby-build
$ brew install rbenv
$ rbenv install 3.1.2
$ rbenv global 3.1.2