how to update ruby with homebrew on mac code example
Example: brew update ruby
$ brew update
$ brew install ruby-build
$ brew install rbenv
$ rbenv install 2.7.0
$ rbenv global 2.7.0
$ brew update
$ brew install ruby-build
$ brew install rbenv
$ rbenv install 2.7.0
$ rbenv global 2.7.0