Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 304
vince Avatar asked Oct 03 '20 15:10

vince


2 Answers

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.

like image 91
Andrei Kovrov Avatar answered Nov 05 '22 01:11

Andrei Kovrov


The answer from @andrei-kovrov is correct but, alternatively, you can wait until this PR gets merged:

https://github.com/Homebrew/homebrew-core/pull/62096

Btw, this answer will not age well so, for reference, this is where the formulae are staged before they get released:

https://github.com/Homebrew/homebrew-core/pulls

like image 28
Daniel Avatar answered Nov 04 '22 23:11

Daniel