Search code examples
rubyrbenv

Upgraded rbenv and still can't install ruby 2.4.0


I am trying to install ruby 2.4.0 using rbenv.

I am using homebrew.

When I tried the following command:

rbenv install ruby 2.4.0 

I get the following:

ruby-build: definition not found: 2.4.0

The following versions contain `2.4.0' in the name:
  2.4.0-dev
  2.4.0-preview1
  rbx-2.4.0

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

I performed the brew update and brew upgrade ruby-build commands and I still get the same message that ruby-build definition 2.4.0 not found.

How can I install ruby 2.4.0 and fix this problem?


Solution

  • I found that I had to do the following:

    brew reinstall ruby-build --HEAD
    

    then I was able to install ruby 2.4.0 using:

    rbenv install 2.4.0
    

    I'm guessing that brew upgrade ruby-build --HEAD did not update the latest ruby installations available.