无法使用rbenv在OSX 10.10 GM 3.0上构建Ruby 2.1.3

时间:2014-10-11 00:33:23

标签: ruby macos

我找到了几个线程,其他用户遇到了类似的问题,但似乎没有一个像这样。

发出命令后:

rbenv install 2.1.3

我收到以下错误:

Installing ruby-2.1.3...

BUILD FAILED (OS X 10.10 using ruby-build 20140926)

Inspect or clean up the working tree at /var/folders/y_/5mjltxsn35q0n_k5817bszlw0000gn/T/ruby-build.20141010202255.63586
Results logged to /var/folders/y_/5mjltxsn35q0n_k5817bszlw0000gn/T/ruby-build.20141010202255.63586.log

Last 10 log lines:
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... no
configure: error: something wrong with CFLAGS=" -O3 -Wno-error=shorten-64-to-32  "
make: *** No targets specified and no makefile found.  Stop.

2 个答案:

答案 0 :(得分:9)

Yosemite seems to be broken上的gcc的Homebrew包。这就是为什么它不起作用的原因。

有同样的问题。运行:

CC=/usr/bin/gcc rbenv install 2.1.3

为我工作。

答案 1 :(得分:0)

这已经在rbenv的ruby-build中得到修复。请通过以下方式更新:

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