11

I am using macOS High Sierra and have been trying to install ruby 2.5.0 thru rbenv but keep getting error as following

Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
error: error reading '/dev/fd/9'
1 error generated.
clang: error: unable to remove file: Operation not permitted
dtrace: failed to compile script probes.d: Preprocessor failed to process input program
make: *** [probes.h] Error 1
make: *** Waiting for unfinished jobs....e

I tried brew doctor and brew upgrade rbenv ruby-build before install rbenv install -v 2.5.0

still getting the same error

Is anyone know how to solve this issue?

Jaz Pin
  • 117
  • 1
  • 7

2 Answers2

17

I had similar problem while installing ruby with ruby-build (used by rbenv and others) and I've avoided it for now using following work-around.

This seems to be due to the dtrace being update with macOS 10.3.3.

First try this, sudo chmod -s /usr/sbin/dtrace

If that doesn't work then disable dtrace while installing ruby

RUBY_CONFIGURE_OPTS="--disable-dtrace" rbenv install 2.5.0

You can also export RUBY_CONFIGURE_OPTS="--disable-dtrace" to your .bashrc or .zshrc file.

The maintaner of rbenv/ruby-build has notified this to ruby core team and hopefully be fixed soon.

zoras
  • 943
  • 1
  • 9
  • 19
11

I was getting crazy and nothing worked, but disabling the antivirus did the trick for me
(using Ruby 2.5.1 on High Sierra and Avira)

Salomanuel
  • 897
  • 10
  • 22
  • 2
    Wow.. just.. wow! Your comment has potentially saved me 3 days of debugging. Too bad I can only give you one upvote :) Too all fellow devs: try to disable avira realtime checking first. – Robbert van den Bogerd Apr 15 '20 at 12:21