2

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?

2 Answers 2

5

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.

0

Start by checking Ruby's version through:

ruby -v

If it's not the version you need, make sure you download it from their Official Website.

Then, if you already have Homebrew installed, you can try the following command:

brew install ruby

Otherwise, you can install Homebrew first through this command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2
  • when I do brew install ruby it tells me that ruby 2.4.0 is already installed.
    – chell
    Commented Mar 17, 2017 at 9:40
  • It should be installed then, try ruby -v to double check.
    – Sheedo
    Commented Mar 17, 2017 at 11:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.