2

我正在尝试使用 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

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

4

2 回答 2

2

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

于 2013-02-17T23:05:09.193 回答
0

看到这个问题和我的回答

总结一下,安装 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
于 2013-02-17T21:31:13.880 回答