What's the right string to use when installing Ruby 3.1 through RVM on Mac OS Big Sur?
Asked Answered
T

2

10

I’m using Mac OS Big Sur and rvm

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

I have version 2.7.5 of Ruby installed and would like to install version 3.1. I tried

$ 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/[email protected]/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.

When I visit the URL https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.tar.gz, I get the message

<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>

Where do I get the key? The rvm info is below

$ 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"
Telethermometer answered 11/1, 2022 at 19:57 Comment(0)
T
15
> 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 doesn't seem to be on the list, but to install it you would use:

> rvm install ruby-3.1.0

or

> rvm install 3.1.0

But again, doesn't seem available, at least in rvm stable or latest. Looking at GitHub, they have merged patches to add 3.1 support but the latest releases don't list it: https://github.com/rvm/rvm/releases.

Timothytimour answered 11/1, 2022 at 20:24 Comment(1)
As of today, I was shown 3.0.0, but not 3.1.2 with rvm upgraded to 1.29.12. And yet, nvm install ruby-3.1.2 worked just fine. I'm on Arch Linux, though (but it shouldn't make a difference).Teazel
P
17

You can install RVM head for now with rvm get head. Then rvm install 3.1 will work as expected.

Peephole answered 25/1, 2022 at 23:24 Comment(0)
T
15
> 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 doesn't seem to be on the list, but to install it you would use:

> rvm install ruby-3.1.0

or

> rvm install 3.1.0

But again, doesn't seem available, at least in rvm stable or latest. Looking at GitHub, they have merged patches to add 3.1 support but the latest releases don't list it: https://github.com/rvm/rvm/releases.

Timothytimour answered 11/1, 2022 at 20:24 Comment(1)
As of today, I was shown 3.0.0, but not 3.1.2 with rvm upgraded to 1.29.12. And yet, nvm install ruby-3.1.2 worked just fine. I'm on Arch Linux, though (but it shouldn't make a difference).Teazel

© 2022 - 2024 — McMap. All rights reserved.