本文介绍了在Mountain Lion,Xcode 4.5和RVM上安装Ruby?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

rvm install 1.9.3 --with-gcc=clang(如所建议)带有RVM的Lion下的Ruby – GCC问题)不起作用,因为clang都不随附Mac OS X 10.8.2(Mountain Lion)和Xcode 4.5.

rvm install 1.9.3 --with-gcc=clang (as suggested by Can't install Ruby under Lion with RVM – GCC issues) doesn't work because neither Mac OS X 10.8.2 (Mountain Lion) nor Xcode 4.5 comes with clang.

是否可以用llvm编译Ruby?

Is it possible to compile Ruby with llvm?

根据 Matthias Schmidt的如何在Mac OS X上使用LLVM和rbenv安装Ruby 1.9.3" ,现在Ruby与LLVM完全兼容.

According to Matthias Schmidt's "How to install Ruby 1.9.3 on Mac OS X with LLVM and rbenv", Ruby is now fully compatible with LLVM.

但是,我仍然得到:error: C compiler cannot create executables

实际上,我在这里/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang找到了clang(由于 Node.js安装Wiki ).我只是在路径中没有clang.

Actually, I found clang here /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang (thanks to the Node.js Installation Wiki). I just didn't have clang in my path.

那么,如果我在路径中添加clang,那么rvm install 1.9.3 --with-gcc=clang就足够了吗?

So, if I add clang to my path, is rvm install 1.9.3 --with-gcc=clang sufficient?

推荐答案

不,ruby与llvm并不完全兼容,Fibers至少存在一个问题,如果llvm的版本发生更改,则可能会发生其他问题.

no, ruby is not fully compatible with llvm, there is at least one issue with Fibers and other issues might occur if version of llvm changes.

Ruby在gcc-4.2上运行效果最好,rvm提供了如何获取它的信息(以及其他重要内容):

Ruby works best with gcc-4.2, rvm provides information how to get it (+other important stuff):

rvm requirements

这篇关于在Mountain Lion,Xcode 4.5和RVM上安装Ruby?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 19:27