Ruby和RVM无法安装ruby-1.9.3-p392

时间:2013-05-04 15:20:03

标签: ruby install rvm

我用正确的命令检查我的ruby版本。

Vincents-MacBook-Pro:~ vincentwarmerdam$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p371]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3-p125
[ruby-]1.9.3-p194
[ruby-]1.9.3-p286
[ruby-]1.9.3-p327
[ruby-]1.9.3-p362
[ruby-]1.9.3-p374
[ruby-]1.9.3-p385
[ruby-]1.9.3-[p392]
[ruby-]1.9.3-head
[ruby-]2.0.0-rc1
[ruby-]2.0.0-rc2
[ruby-]2.0.0[-p0]
ruby-head

列表一直在继续,但我可以看到有许多版本的ruby 1.9.3。我尝试切换到1.9.3的新版本,但是我收到了一个错误。

Vincents-MacBook-Pro:~ vincentwarmerdam$ rvm use 1.9.3
ruby-1.9.3-p392 is not installed.
To install do: 'rvm install ruby-1.9.3-p392'

这对我来说很奇怪,因为我可以看到[ruby-]1.9.3-[p392]出现在列表中。当我尝试安装时,我突然得到了这个:

    Vincents-MacBook-Pro:~ vincentwarmerdam$ rvm install ruby-1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-1.9.3-p392.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
error: Your local changes to the following files would be overwritten by merge:
    suite-sparse.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failed to update tap: homebrew/science
Already up-to-date.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.

apple-gcc42 is not available in PATH, try:

    brew unlink apple-gcc42 && brew link apple-gcc42

and make sure that apple-gcc42 is available in your PATH:

    which gcc-4.2

有人可以向我解释发生了什么吗?我重新安装了RVM,但仍然收到此消息。我只是想能够使用ruby 1.9.3,所以我可以按照我的第一个ruby教程。

2 个答案:

答案 0 :(得分:2)

看起来像suite-sparse.rb是git存储库的一部分,它已经被破坏了。尝试找到该文件,cd到其目录,然后在其上运行git checkout suite-sparse.rb命令。

答案 1 :(得分:1)

原来我需要做的就是为xcode安装命令行工具。这删除了所有错误,因为现在gcc编译器正常工作。