尝试在我的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.
编译一直在进行,但在后来的状态下失败了。
试图找出问题所在,并检查/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 -