Here’s how to install the latest ruby on macOS.

brew install rbenv
rbenv install 2.7.2
rbenv global 2.7.2

See also: