0

I am trying to install ruby 2.5.0 on my system (macOS High Sierra) using rbenv but i'm facing a weird issue as the brew instructions are out of date:

djeustinezzz:~ JUSTINE$ rbenv install rbx-2.5.0

ERROR: Rubinius will not be able to compile using Apple's LLVM-based 
build tools on OS X. You will need to install LLVM 3.5 first.

TO FIX THE PROBLEM: Install Homebrew's llvm package with this
command: brew tap homebrew/versions ; brew install llvm35

BUILD FAILED (OS X 10.13.6 using ruby-build 20160130)

The version 3.5 of LLVM was deleted. After googling here is what i've done:

brew tap homebrew/homebrew-core
brew install [email protected]

But nothing changed.

Homebrew, rbenv and ruby-build are installed and up-to-date.

Precision on why i'm doing this: i just installed Rails 5 on my computer and when i run the server, i have this error:

rbenv: version `ruby-2.5.0' is not installed (set by /Users/JUSTINE/desktop/code/test_five/.ruby-version)

When i run ruby -v, the output is ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17] .

Any idea?

12
  • Can you do rbenv install 2.5.0. Then rbenv local 2.5.0 and rbenv rehash inside your project directory. Commented Sep 3, 2018 at 9:53
  • i have an error when running rbenv install 2.5.0 : ruby-build: definition not found: 2.5.0 ; The following versions contain 2.5.0' in the name: rbx-2.5.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 have tried upgrading ruby-build already but nothing changed.
    – user5914341
    Commented Sep 3, 2018 at 10:05
  • You don't have the formula's updated. that's why. Hold on. Commented Sep 3, 2018 at 10:06
  • 1
    Is there any particular reason why you need such an old version? The current release of Rubinius is 3.107, 2.5.0 is really old. (January 2015, I think.) Since the JIT compiler uses LLVM, you need a matching installation of LLVM with a compatible API. Commented Sep 3, 2018 at 10:09
  • When you run the following rbenv install --list, you should see 2.5.0 Commented Sep 3, 2018 at 10:10

2 Answers 2

3

Clone both rbenv and ruby-build using the below links

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

Now you'll have the ruby-build directory inside plugins.

cd ~/.rbenv
git pull
cd plugins/ruby-build
git pull

After this, you should 2.5.0 when you run rbenv install --list

1
  • Thank you. It worked for me on Ubuntu 16.04
    – Faisal T
    Commented Jun 5, 2023 at 12:29
0

So, what I'd do is try to see if you have the correct version of macOS command line tools installed. You could run:

xcode-select --install

Or you could start from scratch with:

rm -rf /Library/Developer/CommandLineTools

Then install the command line tools with the code above, or the better way which I found, was going directly to the Apple Developer site and downloading the command line tools package itself and installing that.

Install Command Line tools version 10.13 from here.

This issue also came up for me, but it came up when I started running Mojave. I believe it's the same thing here because I got the same errors.