当安装了Xcode 4.3.2并且缺少gcc时,如何使用RVM安装Ruby 1.9.3? [英] How to use RVM to install Ruby 1.9.3 when Xcode 4.3.2 is installed and gcc is missing?
问题描述
我安装了带有Lion的新iMac并安装了Xcode 4.3.2.跑步后
I got a new iMac with Lion and installed Xcode 4.3.2. After running
curl -L get.rvm.io | bash -s stable
我打开了一个新的bash
,并使用了
I opened up a new bash
, and used
$ rvm install 1.9.3
安装Ruby 1.9.3,但出现错误,日志显示C编译器不存在.然后rvm requirements
说:
to install Ruby 1.9.3, but there were errors and the log said that the C compiler is not there. And rvm requirements
says:
$ rvm requirements
[...]
Xcode 4.3+ users
- please be warned
- only ruby-1.9.3-p125+ is partially supported
- in case of any compilation issues:
* downgrade to Xcode 4.1
* uninstall Xcode and install osx-gcc-installer
and reinstall your rubies.
那么这是否意味着我可能需要降级到Xcode 4.1?如果我想保留Xcode 4.3.2怎么办?那么1.9.3-p125 +是否可以工作,但只能部分工作?
So does that mean I might need to downgrade to Xcode 4.1? What if I want to keep Xcode 4.3.2? Then will 1.9.3-p125+ be able to work, but only partially?
更新:或者安装Ruby 1.9.2怎么样-它将与最新的Rails 3.2.3一起使用吗?如果是这样,如何添加gcc? (使用Xcode的gcc吗?)
Update: or how about installing Ruby 1.9.2 -- will it work with the latest Rails 3.2.3? If so, how to add gcc? (using Xcode's gcc?)
推荐答案
要安装1.9.2或更低版本,您需要按照此博客文章中的说明进行操作.它概述了如何获取与Xcode不冲突但可以用于构建Ruby的GCC副本.
To install 1.9.2 or lower you need to follow the instructions in this blog post. It outlines how it get a copy of GCC which does not conflict with Xcode but can be used to build Ruby.
您无法安装osx-gcc-installer,因为它会与Xcode 4.3.2冲突,从而覆盖llvm-gcc和clang的工作版本.
You cannot install the osx-gcc-installer as it will conflict with Xcode 4.3.2, overwriting the working versions of llvm-gcc and clang.
这篇关于当安装了Xcode 4.3.2并且缺少gcc时,如何使用RVM安装Ruby 1.9.3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!