我在全新安装的 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 Does Not Install Ruby 1.9.2 on Snow Leopard: 'Error running 'make '
不幸的是,这似乎破坏了我的整个 rvm 安装,包括 1.9.3。我尝试重新安装 1.9.3,但遇到了与 1.8.7 相同的错误。我此时完全删除了 RVM 并重新安装。再次安装 1.9.3 没有问题。
我还尝试根据这篇文章更新所有版本的 rvm RVM issue with Mountain Lion .那里也没有运气。
更新:我也尝试使用 this walkthrough对于推荐安装 gcc-4.2 的 REE 1.8.7。不幸的是没有运气。
更新 2: 我引用了 rvm 要求并安装了以下软件包
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
到目前为止一切顺利。然后我引用了this post关于需要引用 GCC 编译器。我确定引用的链接可能不正确,因为我使用的是自制软件?我在我的 Cellar 文件夹中找到了编译器并使用了以下命令
CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 rvm install 1.8.7
运气不好。与之前相同的错误消息。
最佳答案
我刚刚知道了!请在 SO 上引用这个问题
rvm can no longer install 1.8.7-p352 on Mac OS X Mountain Lion
rvm reinstall 1.8.7 --without-tcl --without-tk
或者,如果您有 Homebrew,请尝试此安装顺序。
brew install tcl-tk
rvm reinstall 1.8.7
关于ruby - 在 Mountain Lion (10.8) 上安装 Ruby 1.8.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12469530/