How to use RVM to install Ruby 1.9.3 when Xcode 4.3.2 is installed and gcc is missing?

孤街浪徒 提交于 2019-12-09 12:11:52

问题


I got a new iMac with Lion and installed Xcode 4.3.2. After running

curl -L get.rvm.io | bash -s stable

I opened up a new bash, and used

$ rvm install 1.9.3

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.

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?

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:


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.

Xcode 4.3, Homebrew and Ruby.

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.




回答2:


install osx-gcc-installer

use latest ruby:

rvm install ruby

it will be 1.9.3-p125 as it's latest ruby



来源:https://stackoverflow.com/questions/10184357/how-to-use-rvm-to-install-ruby-1-9-3-when-xcode-4-3-2-is-installed-and-gcc-is-mi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!