我在我的全新Mountain Lion系统上安装Ruby 1.8.7时遇到了很多问题。我在Stack Overflow上搜索并没有找到任何明确解决此问题的方法,希望有人曾经遇到过这个问题。
我正在使用可以通过Xcode下载的命令行工具
我使用RVM和HomeBrew安装Ruby 1.9.3时没有遇到任何问题。但是当我尝试安装1.8.7时,在编译后会收到以下消息:
我首先运行了以下命令:
rvm install 1.8.7
这给我带来了这个错误
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
经过一番搜索,我尝试了
rvm install 1.8.7 --with-gcc=clang
Error running 'make ', please read /Users/paulzaich/.rvm/log/ruby-1.8.7-p370/make.log
There has been an error while running make. Halting the installation.
Ruby 'ruby-1.8.7-p370' was built using clang - but it's not (fully) supported, expect errors.
Please be aware that you just installed a ruby that requires 2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-194 which will have all of the latest security patches.
在这个时候,我做了更多的搜索,并发现需要编译自己的readline库。 RVM 在 Snow Leopard 上无法安装 Ruby 1.9.2: 'Error running 'make''
不幸的是,这似乎破坏了我的整个 rvm 安装,包括 1.9.3 版本。 我试图重新安装 1.9.3,但遇到了与 1.8.7 相同的错误。 这时我完全删除了 RVM 并重新安装,没有问题地再次安装了 1.9.3。
我还尝试按照此帖子更新所有版本的 rvm,但仍然没有成功。
更新: 我还尝试使用这个指南来安装 REE 1.8.7,其中推荐安装 gcc-4.2。 不幸的是没有成功。
更新 2: 我参考了 rvm 的要求并安装了以下软件包。
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
到目前为止一切顺利。然后我参考了这篇文章,得知需要引用GCC编译器。我确定所提供的链接可能不正确,因为我正在使用homebrew?我在我的Cellar文件夹中找到了编译器,并使用以下命令:
CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 rvm install 1.8.7
没什么运气。与之前相同的错误消息。