Ruby 编译 ruby 时 “failed to compile script probes.d: Preprocessor not found” 的解决办法

flamen · 2014年06月05日 · 1832 次阅读

今天升级 ruby 时 报错(mac 下): Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.2.0 Thread model: posix compiling miniprelude.c translating probes probes.d compiling bignum.c compiling class.c compiling compar.c dtrace: failed to compile script probes.d: Preprocessor not found make: *** [probes.h] Error 1 make: *** Waiting for unfinished jobs....

错误原因:ruby(2.1.0 2.1.1 2.1.2) 默认打开了 dtrace 选项,1.9.3 无影响

dtrace 选项介绍: The dtrace command is a generic front-end to the DTrace facility. The command implements a simple interface to invoke the D language compiler, the ability to retrieve buffered trace data from the DTrace kernel facility, and a set of basic routines to format and print traced data. Due to the kernel facility it uses to operate, the dtrace command requires root privileges.

看来是 for D 语言的,貌似用不到,关闭之

rbenv 的同学可以用:

export CONFIGURE_OPTS='--disable-dtrace'
rbenv install 2.1.2

直接编译的同学可以用:

./configure --disable-dtrace

google 了半天,有人遇到过但是 reinstall 了 xcode 或 reboot 解决掉,见版友也有人碰到过此问题:https://ruby-china.org/topics/17485 均不适用于我 -_-

贴在这里 希望对碰到类似问题的版友有所帮助

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号