1

尝试在我的 MacOS 上安装 ruby​​ 3.0.3,但在启动时出现此错误:

bash$ asdf install ruby 3.0.3
"$errmsg" is not exported by the Digest::SHA module
Can't continue after import errors at /usr/local/bin/shasum line 24.
BEGIN failed--compilation aborted at /usr/local/bin/shasum line 24.

编译继续进行,但在后来的状态下失败。

4

1 回答 1

1

试图找出问题所在并检查 /usr/local/bin/shasum 命令:

bash$ echo "test" | shasum --algorithm 256
"$errmsg" is not exported by the Digest::SHA module
Can't continue after import errors at /usr/local/bin/shasum line 24.
BEGIN failed--compilation aborted at /usr/local/bin/shasum line 24.

shasum 出了点问题。弄清楚它是如何安装的:

bash$ ls -l /usr/local/bin/shasum
lrwxr-xr-x  1 user  admin  32 Dec  1 09:28 /usr/local/bin/shasum -> ../Cellar/perl/5.34.0/bin/shasum

这告诉我,perl 是通过自制软件安装的,但出了点问题。所以我尝试重新安装 perl 并解决了问题:

bash$ brew reinstall perl
==> Downloading https://ghcr.io/v2/homebrew/core/perl/manifests/5.34.0
...

现在很好:

echo "test" | shasum --algorithm 256
f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2  -
于 2021-12-01T08:41:41.420 回答