怎么在Mountain Lion上安装Ruby1.8.7(10.8)?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (10)

在我安装完整的Mountain Lion上安装Ruby 1.8.7时遇到了很多麻烦。

我正在使用可以用Xcode下载的命令行工具

我通过RVM和HomeBrew安装Ruby 1.9.3时没有遇到任何问题。当我尝试安装1.8.7时,它在尝试编译后收到以下消息:

我第一次运行命令

rvm install 1.8.7

给了我这个错误

The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.

我试了一下

rvm install 1.8.7 --with-gcc=clang

Error running 'make ', please read /Users/paulzaich/.rvm/log/ruby-1.8.7-p370/make.log
There has been an error while running make. Halting the installation.
Ruby 'ruby-1.8.7-p370' was built using clang - but it's not (fully) supported, expect errors.
Please be aware that you just installed a ruby that requires        2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-194 which will have all of the latest security patches.

提问于
用户回答回答于

rvm reinstall 1.8.7 --without-tcl --without-tk

或者,试试这个安装命令。

brew install tcl-tk

rvm reinstall 1.8.7
用户回答回答于

我运行的是OSX 10.8.2,安装1.9.3没有问题,但是1.8.7-p370也失败了。gcc-4.2:

sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2

运行

brew install tcl

...但tk 失败了:

brewk install tk

试试这个小技巧?

CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7 --without-tk

扫码关注云+社区