简体   繁体   中英

Trying to install ruby 2.1.2 with rbenv on OSX BUILD FAILED

So, as the title suggests, I'm trying to install ruby 2.1.2, altough I've tried to install other versions as well, and I'm getting the same errors. I'm running OSX 10.9.2.

I've tried:

Installing a fresh gcc compiler, via brew install gcc47

Installing updated OSX command line tools

Uninstalling rbenv and trying again

Restarting the machine

Here is the sum of what I'm getting:

rbenv install 2.1.2
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb4 25589e6635
Installing ruby-2.1.2...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/6c/h_82199n12515_hd3rcp2x5w0000gn/T/ruby-build.20140528115901.38728
Results logged to /var/folders/6c/h_82199n12515_hd3rcp2x5w0000gn/T/ruby-build.20140528115901.38728.log

Last 10 log lines:
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
compiling miniinit.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
dtrace: failed to compile script probes.d: Preprocessor not found
make: *** [probes.h] Error 1
make: *** Waiting for unfinished jobs....
compiling compar.c

Thoughts?

Gist of verbose output

I was able to build it using:

CONFIGURE_OPTS="--disable-dtrace" rbenv install 2.1.2

Basically that's what is suggested in the question's comment by wicz .

The solution by KurtPreston did not work for me. Also using OS X 10.9.

I was able to get this working in my own environment by:

  1. Removing the gcc installed by Homebrew: brew remove gcc47
  2. Re-installing the XCode Command Line Tools from the XCode Downloads page at https://developer.apple.com/downloads

I was trying to install 2.0 and ran into the same error. However now the CONFIGURE_OPTIONS override doesn't seem to work anymore with rvm at least, so I needed to build it with rvm install --reconfigure -C --disable-dtrace ruby-2.0.0-p594 . This was the first Google result off the error message ("dtrace: failed to compile script probes.d: Preprocessor not found") so I figured I should add this as a current solution for rvm users. Running on OSX Mavericks.

I cannot reproduce this on my machine, sorry. For reference, here's my dtrace version if that should have anything to do with the error:

dtrace -V
  dtrace: Sun D 1.7

You can try to check for XCode and command line tools updates. GCC 4 should not be necessary, you can use the compiler that ships with XCode:

brew uninstall gcc4

Finally, update everything and try again:

brew update
brew upgrade rbenv ruby-build
rbenv uninstall 2.1.2
rbenv install 2.1.2

If that does not work yet: some people have reported that a simple reboot of the machine solved similar errors with dprobe/dtrace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM