2

尝试使用 rvm 在 Mountain Lion 上安装 Ruby,但收到以下错误消息:

ruby-1.9.3-p362 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p362
ruby-1.9.3-p362 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/usr/local/rvm/usr', please read /usr/local/rvm/log/ruby-1.9.3-p362/configure.log
There has been an error while running configure. Halting the installation.
ruby-1.9.3-p362 is not installed.
Creating alias default for ruby-1.9.3-p362.
Recording alias default for ruby-1.9.3-p362.
Creating default links/files
ruby-1.9.3-p362 is not installed.
Could not load ruby ruby-1.9.3-p362.
/usr/local/rvm/scripts/alias: line 111: /usr/local/rvm/rubies/ruby-1.9.3-p362/bin/ruby: No such file or directory

我该怎么做才能正确安装 Ruby?还安装了 Homebrew 包管理器;有冲突吗?

提前致谢。

4

2 回答 2

12

It's probably due to the fact that recent versions of OS X use the LLVM instead of defaulting to the GCC compiler.

Try this:

brew update
brew tap homebrew/dupes
brew install apple-gcc42

to install the GCC compiler. Then:

rvm install 1.9.3 --with-gcc=clang`

EDIT: If the previous solution doesn't work, try giving the following a try before running rvm install 1.9.3:

export CC=/usr/local/bin/gcc-4.2

EDIT 2: The following github page outlines the issue and multiple solutions, added to this post for documentation purposes: Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

于 2012-12-26T19:43:55.297 回答
1

这有关于您需要做什么的详细说明。

RVM 不断设置 ruby​​ 1.8.7 而不是 MAC 中的最新版本 1.9

于 2012-12-27T14:36:28.000 回答