postmodern / ruby-install

Installs Ruby, JRuby, TruffleRuby, or mruby
MIT License
1.89k stars 250 forks source link

ruby-install --update gives failures when trying to download the versions files. #441

Closed Fryguy closed 1 year ago

Fryguy commented 1 year ago

Description

ruby-install --update gives failures when trying to download the versions files. Those files are fine to access from a browser (example), so I'm not sure why it doesn't work. -D doesn't show anything different. Note that this worked fine relatively recently (I think sometime in early January I tried it to start getting Ruby 3.2 locally).

$ ruby-install --update
>>> Downloading latest ruby versions ...
!!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/ruby/versions.txt to /Users/jfrey/.cache/ruby-install/ruby/versions.txt!
>>> Downloading latest jruby versions ...
!!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/jruby/versions.txt to /Users/jfrey/.cache/ruby-install/jruby/versions.txt!
>>> Downloading latest truffleruby versions ...
!!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/truffleruby/versions.txt to /Users/jfrey/.cache/ruby-install/truffleruby/versions.txt!
>>> Downloading latest truffleruby-graalvm versions ...
!!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/truffleruby-graalvm/versions.txt to /Users/jfrey/.cache/ruby-install/truffleruby-graalvm/versions.txt!
>>> Downloading latest mruby versions ...
!!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/mruby/versions.txt to /Users/jfrey/.cache/ruby-install/mruby/versions.txt!
Stable ruby versions:
  ruby:
    2.6.10
    2.7.7
    3.0.5
    3.1.3
    3.2.0
  jruby:
    9.4.0.0
  truffleruby:
    22.3.0
  truffleruby-graalvm:
    22.3.0
  mruby:
    3.0.0

Steps To Reproduce

Steps to reproduce the bug:

  1. $ ruby-install --update or just $ ruby-install

Expected Behavior

No errors

Actual Behavior

!!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/ruby/versions.txt to /Users/jfrey/.cache/ruby-install/ruby/versions.txt!

Environment

$ ruby-install --version
ruby-install: 0.9.0

$ uname -a
Darwin jf-mac.xxx 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:44:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_X86_64 x86_64

$ cc --version
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ openssl version
LibreSSL 2.8.3
Fryguy commented 1 year ago

I removed the >/dev/null 2>&1 from https://github.com/postmodern/ruby-install/blob/49e73f6700d9bae339271510e1b43ac237b470bc/share/ruby-install/ruby-versions.sh#L50 and now I see:

>>> Downloading latest ruby versions ...
dyld[44339]: Library not loaded: '/usr/local/opt/libunistring/lib/libunistring.2.dylib'
  Referenced from: '/usr/local/Cellar/wget/1.21.3/bin/wget'
  Reason: tried: '/usr/local/opt/libunistring/lib/libunistring.2.dylib' (no such file), '/usr/local/lib/libunistring.2.dylib' (no such file), '/usr/lib/libunistring.2.dylib' (no such file), '/usr/local/Cellar/libunistring/1.1/lib/libunistring.2.dylib' (no such file), '/usr/local/lib/libunistring.2.dylib' (no such file), '/usr/lib/libunistring.2.dylib' (no such file)
/usr/local/bin/../share/ruby-install/logging.sh: line 61: 44339 Abort trap: 6           $@
!!! Failed to download https://raw.githubusercontent.com/postmodern/ruby-versions/master/ruby/versions.txt to /Users/jfrey/.cache/ruby-install/ruby/versions.txt!

which looks like my wget somehow broke when my system updated (I recall that happening some time in the past week)

So, I did a brew reinstall wget, and now everything seems good!

$ruby-install --update
>>> Downloading latest ruby versions ...
>>> Downloading latest jruby versions ...
>>> Downloading latest truffleruby versions ...
>>> Downloading latest truffleruby-graalvm versions ...
>>> Downloading latest mruby versions ...
Stable ruby versions:
  ruby:
    2.6.10
    2.7.7
    3.0.5
    3.1.3
    3.2.0
  jruby:
    9.4.0.0
  truffleruby:
    22.3.1
  truffleruby-graalvm:
    22.3.1
  mruby:
    3.0.0
Fryguy commented 1 year ago

So, that being said, I can close this, but I'm wondering if it would be helpful if when --debug is present that the download's >/dev/null 2>&1 be removed? That would have helped me solve this directly.

postmodern commented 1 year ago

@Fryguy I am going to guess this is some curl SSL CA bundle issue with homebrew? That's a great idea, the version file downloads should be properly exposed when debugging is enabled.

postmodern commented 1 year ago

@Fryguy OK I made the necessary changes in b2db3ce.

Fryguy commented 1 year ago

Thank you! I'll close this now.