1

我使用正确的命令检查我拥有哪些版本的 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​​ 教程进行操作。

4

2 回答 2

2

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

于 2013-05-04T15:41:35.640 回答
1

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

于 2013-05-06T00:16:22.357 回答