安装Xcode 4.3.2并缺少gcc时如何使用RVM安装Ruby 1.9.3?
我用Lion购买了一台新的iMac并安装了Xcode 4.3.2。 跑完之后
curl -L get.rvm.io | bash -s stable
我打开了一个新的bash
,然后使用了
$ rvm install 1.9.3
安装Ruby 1.9.3,但有错误,日志说C编译器不存在。 并且rvm requirements
说:
$ 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 +能够工作,但只能部分?
更新:或安装Ruby 1.9.2如何 – 它将与最新的Rails 3.2.3一起使用? 如果是这样,如何添加gcc? (使用Xcode的gcc?)
要安装1.9.2或更低版本,您需要按照此博客文章中的说明进行操作。 它概述了如何获得与Xcode不冲突但可用于构建Ruby的GCC副本。
Xcode 4.3,Homebrew和Ruby 。
您无法安装osx-gcc-installer,因为它会与Xcode 4.3.2冲突,覆盖llvm-gcc和clang的工作版本。
安装osx-gcc-installer
使用最新的ruby:
rvm install ruby
它将是1.9.3-p125
因为它是最新的ruby