首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在Mountain Lion (10.8)上安装Ruby 1.8.7

在Mountain Lion (10.8)上安装Ruby 1.8.7
EN

Stack Overflow用户
提问于 2012-09-18 10:17:54
回答 3查看 10.5K关注 0票数 17

在我全新安装的Mountain Lion上安装Ruby 1.8.7时遇到了很多麻烦。我在Stack Overflow上看了看,没有看到任何专门解决这个问题的东西,希望有人以前遇到过这个问题。

我使用的是可以用Xcode下载的命令行工具

我通过RVM和HomeBrew安装Ruby1.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 issue with Mountain Lion更新所有版本的rvm。也没什么好运气的。

更新:我也尝试过使用REE1.8.7的this walkthrough,它建议安装gcc-4.2。不幸的是没有运气。

更新2: i参考了rvm要求并安装了以下软件包

brew update
brew tap homebrew/dupes 
brew install autoconf automake apple-gcc42 
rvm pkg install openssl

到目前一切尚好。然后,我在需要引用GCC编译器时引用了this post。我确定引用的链接可能不正确,因为我使用的是自制软件?我在我的Cellar文件夹中找到了编译器,并使用了以下命令

CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 rvm install 1.8.7

不走运。与之前相同的错误消息。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2012-09-18 20:14:08

我刚想通了!请在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
票数 48
EN

Stack Overflow用户

发布于 2012-10-05 14:55:39

只是为了跟进Paul's的帖子。我运行的是OSX 10.8.2,1.9.3安装没有问题,但1.8.7-p370也失败了。我符号链接了gcc-4.2:

sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2

...successfully运行:

brew install tcl

...but tk failed

brewk install tk

如果您处于相同的位置,则此命令起到了作用:

CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7 --without-tk
票数 4
EN

Stack Overflow用户

发布于 2012-09-18 19:01:33

最新的Xcode只提供了clang --不是GNU,你需要安装gcc-4.2才能正确编译Ruby1.8.7,下面的命令会显示可用的选项:

rvm requirements

目前只有ruby 1.9.3-p125和更高版本对clang的支持有限,但这是有限的支持,仍然可以找到错误。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12469530

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档