如何在Windows上安装GnuPG :: Interface perl模块?

时间:2017-10-30 22:03:11

标签: perl cpan

当我尝试这样做时:cpan install GnuPG :: Interface 在Strawberry或Activeperl(windows)上我收到此错误: 我使用最后的perl版本5.26.1.1

CPAN: File::Temp loaded ok (v0.2304)
CPAN: YAML::XS loaded ok (v0.66)
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::CoreList loaded ok (v5.20170821)
Configuring A/AL/ALEXMV/GnuPG-Interface-0.52.tar.gz with Makefile.PL
which gpg ... 'which' is not recognized as an internal or external command,
operable program or batch file.
gpg (GnuPG) not found at Makefile.PL line 7.
 Warning: No success on command[C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=si
te]
   ALEXMV/GnuPG-Interface-0.52.tar.gz
   C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK

任何提示?我实际上试图安装Mail :: GnuPG但需要GnuPG :: Interface。 谢谢

1 个答案:

答案 0 :(得分:1)

This line in Makefile.PL

system("which", "gpg");
die "gpg (GnuPG) not found" if ( $? != 0 );

正在尝试检查gpg中是否存在%PATH%,但由于您没有标准* nix实用程序which,因此会失败。您可以安装Perl的App::pwhich,如果您愿意,可以将该行替换为system("pwhich", "gpg");,或者,如果您知道gpg位于%PATH%,则删除该行完全Makefile.PL

或者,您可以安装Git for Windowswhichgpg以及perl 5.24.1

如果要从头开始重写此Makefile.PL,我建议您使用File::Which检查%PATH%存在gpg可执行文件的所有位置。