由于 Digest::SHA 模块中的错误,无法使用 asdf 编译任何内容
Posted
技术标签:
【中文标题】由于 Digest::SHA 模块中的错误,无法使用 asdf 编译任何内容【英文标题】:Can't compile anything with asdf due to error in Digest::SHA module 【发布时间】:2022-01-07 20:50:09 【问题描述】:尝试在我的 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.
编译继续进行,但在稍后的状态下失败。
【问题讨论】:
【参考方案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 -
【讨论】:
以上是关于由于 Digest::SHA 模块中的错误,无法使用 asdf 编译任何内容的主要内容,如果未能解决你的问题,请参考以下文章
Ruby on Rails 将盐传递给 Digest::SHA512