$ brew update
$ brew install ruby-build
$ brew install rbenv
指定版本
$ rbenv install 2.7.6
$ rbenv global 2.7.6
配置
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
如果电脑是 Ventura 路径要修改成下面的
"$HOME/.rbenv/shims:$PATH"