繁体   English   中英

Perl 无法加载 SSLeay.dll 因为 LWP::Protocol::https 未安装

[英]Perl can't load SSLeay.dll because LWP::Protocol::https is not installed

我工作的公司使用Slack进行内部消息传递。 它允许与大量不同的软件和服务进行大量出色的集成。 我正在制作自己的机器人,用于将 webhook 发送到 Slack。

我把所有东西都设置好并开始工作了,我有一个 Perl 脚本,它发送一个 JSON 有效负载。 如果我手动触发脚本,一切都会完美无缺,我的 Slack 机器人会发送消息。

但是,当脚本被Finalbuilder (用于自动构建处理的软件)触发时,它会失败。 我得到以下回复:

501 Can't load 'C:/Strawberry/perl/site/lib/auto/Net/SSLeay/SSLeay.dll' for module Net::SSLeay: load_file:The specified module could not be found (LWP::Protocol::https not installed)

所以我想我需要安装“LWP::Protocol::https”模块。 我刚刚打开我的 cpan 客户端并写了install LWP::Protocol::https

安装模块后仍然报错。 我写了test LWP::Protocol:https ,它给出了以下响应:

Running test for module 'LWP::Protocol::https'
Running make for M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz
Checksum for C:\Strawberry\cpan\sources\authors\id\M\MS\MSCHILLI\LWP-Protocol-https-6.06.tar.gz ok
Scanning cache C:\Strawberry\cpan\build for sizes
............................................................................DONE

  CPAN.pm: Going to build M/MS/MSCHILLI/LWP-Protocol-https-6.06.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for LWP::Protocol::https
Could not read metadata file. Falling back to other methods to determine prerequisites
cp lib/LWP/Protocol/https.pm blib\lib\LWP\Protocol\https.pm
  MSCHILLI/LWP-Protocol-https-6.06.tar.gz
  C:\Strawberry\c\bin\dmake.EXE -- OK
Running make test
C:\Strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,'blib\lib', 'blib\arch')" t/*.t
t/apache.t ....... ok
t/https_proxy.t .. 1/56 # creating cert for direct.ssl.access
# creating cert for direct.ssl.access
# creating cert for foo
# creating cert for bar
# creating cert for foo
# creating cert for foo
# creating cert for bar
# creating cert for bar
t/https_proxy.t .. ok
All tests successful.
Files=2, Tests=61,  8 wallclock secs ( 0.02 usr +  0.01 sys =  0.03 CPU)
Result: PASS
  MSCHILLI/LWP-Protocol-https-6.06.tar.gz
  C:\Strawberry\c\bin\dmake.EXE test -- OK

我可以使用 windows CMD 或 Finalbuilder 来触发我的脚本。 两者都可以正常工作,但是当通过 Continua CI 激活 Finalbuilder 项目时,我收到“无法加载 ssleay.dll”错误。

我不知道现在该怎么办。 有谁知道我可以如何修复 Perl 错误?

从 IDE 运行脚本时,我遇到了同样的错误,但不是从命令行(同样的问题)。

我的命令行正在将这些添加到路径中。 (这些不是全局定义的)。

c:\perl\perl\bin;c:\perl\sup\bin;c:\perl\c\bin;

但是 IDE 没有这些。 所以同样的修复应该适用于 FinalBuilder,它缺少 perl 路径信息。

您是否加载了 header 文件? 我不知道 Windows 是什么,但在 Linux 中,它们被称为: libssl-devzlib1g-dev

我也有一段时间有这个错误。 就我而言,解决方案非常简单。 原来我没有重新启动 SVN 服务,所以当它运行post-commit.bat文件时,PATH 环境没有更新以反映在 Perl 安装期间添加的新路径。

当我在测试时,我正在从具有正确路径的新控制台 window 运行,但是一旦它通过 SVN 从批处理文件运行,它就坏了,与您发布的错误完全相同。

IDE Eclipse 的问题相同,命令行正常,但 IDE 出现错误。 我检查位置:

C:\>perldoc -l LWP::Protocol::https
C:\zailperl\perl\vendor\lib\LWP\Protocol\https.pm

我将它添加到环境变量中。 我不想重新启动我的电脑,所以我将父路径添加到 IDE。 右键单击项目。

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM