0

我正在使用 Mac OS Big Sur 和 rvm

$ rvm -v
rvm 1.29.12-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

我安装了 2.7.5 版的 Ruby,想安装 3.1 版。我试过

$ rvm install 3.1
Unknown ruby string (do not know how to handle): ruby-3.1.
Unknown ruby string (do not know how to handle): ruby-3.1.
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/11.6/x86_64/ruby-3.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Unknown ruby string (do not know how to handle): ruby-3.1.
Installing Ruby from source to: /Users/davea/.rvm/rubies/ruby-3.1, this may take a while depending on your cpu(s)...
Unknown ruby string (do not know how to handle): ruby-3.1.
ruby-3.1 - #downloading ruby-3.1, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 
The requested url does not exist(22): 'https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.tar.gz'
Checking fallback: https://ftp.ruby-lang.org/pub/ruby/3.1/ruby-3.1.tar.gz
No fallback URL could be found, try increasing timeout with:

    echo "export rvm_max_time_flag=20" >> ~/.rvmrc

There has been an error fetching the ruby interpreter. Halting the installation.

当我访问 URL https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.tar.gz时,我收到消息

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>pub/ruby/3.1/ruby-3.1.tar.gz</Key>
<RequestId>8DG8HS5XNTY4XMG4</RequestId>
<HostId>mOBmNj3QbUmQtw61eviwWGXeG9PTNUYS9S6F+BmBGtWe4zscHGk8UBqYMnwP+rcpkywMq10QxLA=</HostId>
</Error>

我在哪里得到钥匙?rvm信息如下

$ rvm info

ruby-2.7.5@my-project:

  system:
    uname:        "Darwin localhost 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64"
    name:         "OSX"
    version:      "11.6"
    architecture: "x86_64"
    bash:         "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)"
    zsh:          "/bin/zsh => zsh 5.8 (x86_64-apple-darwin20.0)"
    remote_path:  "osx/11.6/x86_64"
    xcode:        "13.2.1"

  rvm:
    version:      "1.29.12-next (master)"
    updated:      "2 months 22 hours 58 seconds ago"
    path:         "/Users/davea/.rvm"
    autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  ruby:
    interpreter:  "ruby"
    version:      "2.7.5p203"
    date:         "2021-11-24"
    platform:     "x86_64-darwin20"
    patchlevel:   "2021-11-24 revision f69aeb8314"
    full_version: "ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin20]"

  homes:
    gem:          "/Users/davea/.rvm/gems/ruby-2.7.5@my-project"
    ruby:         "/Users/davea/.rvm/rubies/ruby-2.7.5"

  binaries:
    ruby:         "/Users/davea/.rvm/rubies/ruby-2.7.5/bin/ruby"
    irb:          "/Users/davea/.rvm/rubies/ruby-2.7.5/bin/irb"
    gem:          "/Users/davea/.rvm/rubies/ruby-2.7.5/bin/gem"
    rake:         "/Users/davea/.rvm/gems/ruby-2.7.5@my-project/bin/rake"

  environment:
    PATH:         "/Users/davea/.rvm/gems/ruby-2.7.5@my-project/bin:/Users/davea/.rvm/gems/ruby-2.7.5@global/bin:/Users/davea/.rvm/rubies/ruby-2.7.5/bin:/Users/davea/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/davea/.cabal/bin:/Users/davea/.ghcup/bin:/Users/davea/.cabal/bin:/Users/davea/.ghcup/bin:/Users/davea/.cabal/bin:/Users/davea/.ghcup/bin"
    GEM_HOME:     "/Users/davea/.rvm/gems/ruby-2.7.5@my-project"
    GEM_PATH:     "/Users/davea/.rvm/gems/ruby-2.7.5@my-project:/Users/davea/.rvm/gems/ruby-2.7.5@global"
    MY_RUBY_HOME: "/Users/davea/.rvm/rubies/ruby-2.7.5"
    IRBRC:        "/Users/davea/.rvm/rubies/ruby-2.7.5/.irbrc"
    RUBYOPT:      ""
    gemset:       "my-project"
4

2 回答 2

3
> rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.10]
[ruby-]2.5[.8]
[ruby-]2.6[.6]
[ruby-]2.7[.2]
[ruby-]3[.0.0]
ruby-head

3.1 似乎不在列表中,但要安装它,您将使用:

> rvm install ruby-3.1.0

或者

> rvm install 3.1.0

但同样,似乎不可用,至少在 rvm stable 或最新版本中。查看 GitHub,他们已合并补丁以添加 3.1 支持,但最新版本未列出:https ://github.com/rvm/rvm/releases 。

于 2022-01-11T20:24:40.043 回答
0

您现在可以使用rvm get head. 然后rvm install 3.1将按预期工作。

于 2022-01-25T23:24:56.177 回答