rubyhomebrewrbenvruby-build

Need help installing Ruby 2.7.2 on Mac


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

and then

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

Solution

  • You need to install the latest 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.