rbenv

Manage multiple Ruby versions on your system

brewmacoslinux
Try with needOr install directly
Source

About

Ruby version manager

Commands

rbenv

Examples

List all installed Ruby versions$ rbenv versions
Install a specific Ruby version$ rbenv install 3.2.0
Set the global Ruby version$ rbenv global 3.2.0