【问题标题】:Ruby and RVM cannot install ruby-1.9.3-p392Ruby 和 RVM 无法安装 ruby​​-1.9.3-p392
【发布时间】:2013-05-04 15:20:03
【问题描述】:

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

【问题讨论】:

  • 您是否尝试按照有关 gcc 的说明进行操作?要安装 ruby​​,您需要一个编译器 (gcc)
  • list known 只是列出了 RVM 知道的所有版本。这并不意味着您已经安装了所有这些。您必须先安装该列表中的一个,然后才能使用它。

标签: ruby installation rvm


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

    • 您可以添加您的分辨率作为答案并接受它吗?此外,现在您可以使用 xcode-select --install 从 XCode 安装命令行工具(假设您已安装 XCode)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-17
    • 1970-01-01
    • 1970-01-01
    • 2012-02-22
    相关资源
    最近更新 更多