因此,正如标题所暗示的那样,我正在尝试安装
ruby 2.1.2,尽管我已经尝试安装其他版本,但我遇到了同样的错误.我正在运行OSX 10.9.2.
我试过了:
通过brew install gcc47安装新的gcc编译器
安装更新的OSX命令行工具
卸载rbenv并再次尝试
重启机器
这是我得到的总和:
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
思考?
解决方法
我能够使用以下方法构建它:
CONFIGURE_OPTS="--disable-dtrace" rbenv install 2.1.2
KurtPreston的解决方案对我不起作用.也使用OS X 10.9.