使用RVM安装Ruby 1.9.3时出错

时间:2013-02-17 21:18:48

标签: ruby rvm

我正在尝试使用Mountain Lion在我的工作机器上安装Ruby 1.9.3-p385。

我已安装RVM并运行

rvm install 1.9.3

但是我得到了这个错误...

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p385 --with-opt-dir=/usr/local/rvm/usr --disable-shared', please read /usr/local/rvm/log/ruby-1.9.3-p385/configure.log
There has been an error while running configure. Halting the installation.

这是错误指向...的

的configure.log的内容
[2013-02-18 10:10:50] ./configure
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1
checking whether the C compiler works... no
configure: error: in `/usr/local/rvm/src/ruby-1.9.3-p385':
configure: error: C compiler cannot create executables
See `config.log' for more details

这对我来说有点神秘。如果有人能提供帮助,我们将不胜感激。

2 个答案:

答案 0 :(得分:2)

这是railsinstaller默认设置的问题,请查看此答案https://stackoverflow.com/a/12929017/497756

答案 1 :(得分:0)

请参阅this问题和my answer

总结一下,安装MacPorts并运行:

sudo port selfupdate
sudo port install gcc-apple42
CC=/opt/local/bin/gcc-apple-4.2 rvm install ruby-1.9.3-p194 --enable-shared --without-tk --without-tcl