我终于在(新的)Mac OsX 10.8.2 上进行了安装。主要问题是没有gcc就无法编译ruby,甚至系统中确实存在gcc4.2。
首先你必须检查你的 gcc 版本
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
你也应该得到最新的 rvm
$ rvm get latest
现在,将 gcc 编译器指向 rvm,以便 rvm 可以使用它来编译 ruby
$ CC=/usr/bin/gcc rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p374.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /Users/bubuzzz/.rvm/archives
Extracting yaml to /Users/bubuzzz/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/bubuzzz/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/bubuzzz/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/bubuzzz/.rvm/usr
Building 'ruby-1.9.3-p374' using clang - but it's not (fully) supported, expect errors.
Installing Ruby from source to: /Users/bubuzzz/.rvm/rubies/ruby-1.9.3-p374, this may take a while depending on your cpu(s)...
ruby-1.9.3-p374 - #downloading ruby-1.9.3-p374, this may take a while depending on your connection...
ruby-1.9.3-p374 - #extracted to /Users/bubuzzz/.rvm/src/ruby-1.9.3-p374 (already extracted)
ruby-1.9.3-p374 - #configuring
ruby-1.9.3-p374 - #compiling
ruby-1.9.3-p374 - #installing
Retrieving rubygems-1.8.25
######################################################################## 100.0%
Extracting rubygems-1.8.25 ...
Removing old Rubygems files...
Installing rubygems-1.8.25 for ruby-1.9.3-p374 ...
Installation of rubygems completed successfully.
Saving wrappers to '/Users/bubuzzz/.rvm/bin'.
ruby-1.9.3-p374 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p374 - #importing default gemsets, this may take time ...
Install of ruby-1.9.3-p374 - #complete
Ruby 'ruby-1.9.3-p374' was built using clang - but it's not (fully) supported, expect errors.
安装结束时有一个小问题(警告消息),但至少,ruby 现在可以工作了
$ ruby --version
ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.1]
干杯