在Mountain Lion上安装Ruby 1.8.7(10.8)

Pau*_*aul 17 ruby rvm osx-mountain-lion

我在山狮的干净安装上安装Ruby 1.8.7时遇到了很多麻烦.我查看了Stack Overflow并没有看到任何专门解决此问题的内容,并希望有人可能之前遇到过此问题.

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

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

我第一次运行命令

rvm install 1.8.7
Run Code Online (Sandbox Code Playgroud)

这给了我这个错误

The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
Run Code Online (Sandbox Code Playgroud)

挖了一下后我试了一下

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.
Run Code Online (Sandbox Code Playgroud)

此时我做了一些搜索,发现需要编译我自己的readline.RVM无法在Snow Leopard上安装Ruby 1.9.2:'运行'make'时出错

不幸的是,这似乎破坏了我的整个rvm安装,包括1.9.3.我尝试重新安装1.9.3并得到了与1.8.7相同的错误.我此时完全删除了RVM并重新安装.没有问题再次安装1.9.3.

我还尝试使用Mountain Lion更新所有版本的rvm .也没有运气.

更新:我还尝试使用REE 1.8.7的演练,建议安装gcc-4.2.不幸的是没有运气.

更新2:我参考了rvm要求并安装了以下软件包

brew update
brew tap homebrew/dupes 
brew install autoconf automake apple-gcc42 
rvm pkg install openssl
Run Code Online (Sandbox Code Playgroud)

到现在为止还挺好.然后我引用了这篇关于需要引用GCC编译器的帖子.我确定引用的链接可能不正确,因为我正在使用自制软件?我在Cellar文件夹中找到了编译器并使用了以下命令

CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 rvm install 1.8.7
Run Code Online (Sandbox Code Playgroud)

没运气.与以前相同的错误消息.

Pau*_*aul 48

我只想出来了!请在SO上参考这个问题

rvm无法再在Mac OS X Mountain Lion上安装1.8.7-p352

rvm reinstall 1.8.7 --without-tcl --without-tk
Run Code Online (Sandbox Code Playgroud)

或者,如果您有自制软件,请尝试此安装顺序.

brew install tcl-tk

rvm reinstall 1.8.7
Run Code Online (Sandbox Code Playgroud)