需要帮助在 Mac 上安装 Ruby 2.7.2

需要帮助在 Mac 上安装 Ruby 2.7.2

问题描述:

我正在尝试在我的 Mac(带有所有更新的最新操作系统)上安装 Ruby 版本 2.7.2 并执行以下操作

I'm trying to install Ruby version 2.7.2 on my Mac (latest OS with all updates) and did the following

brew update
brew upgrade rbenv ruby-build

然后

rbenv install 2.7.2
ruby-build: definition not found: 2.7.2

See all available versions with `rbenv install --list'.

If the version you need is missing, try upgrading ruby-build:

  brew update && brew upgrade ruby-build

所以我尝试按照上面的说明操作并得到这个

So I tried following the instructions above and get this

brew update && brew upgrade ruby-build
Already up-to-date.
Warning: ruby-build 20200926 already installed

需要安装最新的ruby-build

$ brew unlink ruby-build # remove STABLE version
$ brew install --HEAD ruby-build 
$ rbenv install -l | grep '2.7.2'
2.7.2


Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all' to show all local versions.