Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS ruby-install: Fails with -r: No such file or directory #486

Open
coffeegist opened this issue Aug 6, 2024 · 3 comments
Open

MacOS ruby-install: Fails with -r: No such file or directory #486

coffeegist opened this issue Aug 6, 2024 · 3 comments
Assignees
Labels

Comments

@coffeegist
Copy link

Description

When verifying the sha1 hash of the downloaded ruby-x-y-z.tar.xz file, there is no hash calculated on MacOS (14.5). This is due to the sha1 -r option provided in the ruby-install process. On MacOS, running sha1 -r results in the result, -r: No such file or directory. This is reported in the output by ruby-install.

Steps To Reproduce

Steps to reproduce the bug:

  1. $ ruby-install -D ruby 3.1.3

Expected Behavior

The application should run sha1 <filename> instead, resulting in a successful pass.

Actual Behavior

$ ruby-install -D ruby 3.1.3
>>> Installing ruby 3.1.3 into /Users/user/.rubies/ruby-3.1.3 ...
>>> Installing dependencies for ruby 3.1.3 ...
Warning: automake 1.17 is already installed and up-to-date.
To reinstall 1.17, run:
  brew reinstall automake
Warning: bison 3.8.2 is already installed and up-to-date.
To reinstall 3.8.2, run:
  brew reinstall bison
Warning: readline 8.2.10 is already installed and up-to-date.
To reinstall 8.2.10, run:
  brew reinstall readline
Warning: libyaml 0.2.5 is already installed and up-to-date.
To reinstall 0.2.5, run:
  brew reinstall libyaml
Warning: gdbm 1.24 is already installed and up-to-date.
To reinstall 1.24, run:
  brew reinstall gdbm
Warning: libffi 3.4.6 is already installed and up-to-date.
To reinstall 3.4.6, run:
  brew reinstall libffi
Warning: openssl@3 3.3.1 is already installed and up-to-date.
To reinstall 3.3.1, run:
  brew reinstall openssl@3
>>> Downloading https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.3.tar.xz into /Users/user/src ...
>>> Verifying ruby-3.1.3.tar.xz ...
-r: No such file or directory
!!! Invalid sha1 checksum for /Users/user/src/ruby-3.1.3.tar.xz
!!!   expected: 12998178c3d17fa8a9d8300c7caab460b0e698c0
!!!   actual:
!!! Verification of ruby-3.1.3.tar.xz failed!

Environment

$  ~ ruby-install --version
ruby-install: 0.9.3
$  ~ uname -a
Darwin hostname.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64
$  ~ cc --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$  ~ openssl version
OpenSSL 3.3.1 4 Jun 2024 (Library: OpenSSL 3.3.1 4 Jun 2024)
@coffeegist coffeegist added the bug label Aug 6, 2024
@postmodern
Copy link
Owner

postmodern commented Aug 6, 2024

Odd, appears that macOS changed their sha1 command. Which version of macOS are you running? Did you upgrade recently? I am assuming this is a recent change? Also could you double check that sha1 isn't aliased to some other command? Also could you double check that the /Users/user/src/ruby-3.1.3.tar.xz file actually does exist?

@postmodern postmodern self-assigned this Aug 6, 2024
@monfresh
Copy link

monfresh commented Aug 7, 2024

I cannot reproduce this on macOS Sonoma 14.5. The sha1 command does not exist by default on macOS Sonoma (and possibly older versions too). In my case, ruby-install finds these other commands first:

>>> Verifying ruby-3.1.5.tar.xz ...
[DEBUG] md5sum /Users/moncef/src/ruby-3.1.5.tar.xz
[DEBUG] sha1sum /Users/moncef/src/ruby-3.1.5.tar.xz
[DEBUG] sha256sum /Users/moncef/src/ruby-3.1.5.tar.xz
[DEBUG] sha512sum /Users/moncef/src/ruby-3.1.5.tar.xz

@coffeegist
Copy link
Author

@postmodern sorry for the delay. I'm on macOS 14.5 and can confirm what @monfresh said in that sha1 doesn't seem to have existed by default. The sha1 installed on my machine seems to be part of a brew install for hashcash. I did confirm that the /Users/user/src/ruby-3.1.3.tar.xz file existed, manually verified the hash and then added the argument to disable hash checking on that file to get it to continue. Apologies for the spin-up on this edge case of a sha1 tool existing that normally doesn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants