【发布时间】:2012-04-17 02:38:25
【问题描述】:
我得到了一台带有 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?)
【问题讨论】:
-
cd /tmp ; echo "int main(int argc, char *argv) { return 0; }" > foo.c ; gcc -o foo foo.c ; ./foo && echo success || echo failure的输出是什么? -
当我自己输入
gcc时,它会显示-bash: gcc: command not found -
试试最后一条建议on this answer:
rvm install 1.9.3 --with-gcc=clang -
如果我使用那条线,它会说
You requested building with 'clang' but it is not in your path. -
转到 Xcode、首选项、下载,然后安装命令行工具。这应该会有所帮助,我希望。我使用的是 Xcode 4.2,我确实单独安装了 gcc。但是我在其他地方读到,在 4.3 中,当您安装命令行工具时,您会得到 gcc(或至少为 clang 编译器提供 gcc 包装器)。
标签: ruby-on-rails xcode macos rvm