简体   繁体   English

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

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

For internal messaging the company I work for uses Slack .我工作的公司使用Slack进行内部消息传递。 It allows for a lot of awesome integration with tons of different software and services.它允许与大量不同的软件和服务进行大量出色的集成。 I'm making my own bot for sending webhooks to Slack.我正在制作自己的机器人,用于将 webhook 发送到 Slack。

I got everything set up and working, I have a Perl script that sends a JSON payload.我把所有东西都设置好并开始工作了,我有一个 Perl 脚本,它发送一个 JSON 有效负载。 If I trigger the script manually, everything works flawlessly and my Slack bot sends messages.如果我手动触发脚本,一切都会完美无缺,我的 Slack 机器人会发送消息。

However, when the script gets triggered by Finalbuilder (Software for automatic build processing), it it fails.但是,当脚本被Finalbuilder (用于自动构建处理的软件)触发时,它会失败。 I get the following response:我得到以下回复:

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)

So I figured I needed to install the "LWP::Protocol::https" module.所以我想我需要安装“LWP::Protocol::https”模块。 I just opened my cpan client and wrote install LWP::Protocol::https我刚刚打开我的 cpan 客户端并写了install LWP::Protocol::https

Still get the error after installing the module.安装模块后仍然报错。 I wrote test LWP::Protocol:https , which gave the following response:我写了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

I can trigger my script with windows CMD, or Finalbuilder.我可以使用 windows CMD 或 Finalbuilder 来触发我的脚本。 Both will work just fine , but when the Finalbuilder project gets activated through Continua CI, I get the "can't load ssleay.dll" error.两者都可以正常工作,但是当通过 Continua CI 激活 Finalbuilder 项目时,我收到“无法加载 ssleay.dll”错误。

I have no clue what to do now.我不知道现在该怎么办。 Does anyone know how I can fix the Perl error?有谁知道我可以如何修复 Perl 错误?

I got this same error while running scripts from IDE, but not from command line (same issue).从 IDE 运行脚本时,我遇到了同样的错误,但不是从命令行(同样的问题)。

My command line was adding these to the path.我的命令行正在将这些添加到路径中。 (These were not globally defined). (这些不是全局定义的)。

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

But the IDE didn't have these.但是 IDE 没有这些。 So same fix should work for FinalBuilder, it is missing the perl path information.所以同样的修复应该适用于 FinalBuilder,它缺少 perl 路径信息。

Have you loaded the header files?您是否加载了 header 文件? I don't know what they are for Windows but in Linux, they're called: libssl-dev and zlib1g-dev我不知道 Windows 是什么,但在 Linux 中,它们被称为: libssl-devzlib1g-dev

I also had this error for awhile.我也有一段时间有这个错误。 In my case the solution was quite simple.就我而言,解决方案非常简单。 It turned out that I hadn't restarted the SVN service, so when it ran the post-commit.bat file the PATH environment hadn't been updated to reflect the new paths that had been added during the Perl install.原来我没有重新启动 SVN 服务,所以当它运行post-commit.bat文件时,PATH 环境没有更新以反映在 Perl 安装期间添加的新路径。

While I was testing I was running from a new console window which had the correct PATH, but as soon as it ran from the batch file via SVN it broke, with exactly the same error you posted.当我在测试时,我正在从具有正确路径的新控制台 window 运行,但是一旦它通过 SVN 从批处理文件运行,它就坏了,与您发布的错误完全相同。

Same problem with IDE Eclipse, command line fine but error with IDE. IDE Eclipse 的问题相同,命令行正常,但 IDE 出现错误。 I check the location:我检查位置:

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

And I add it to Environments variables.我将它添加到环境变量中。 I didn't want to reboot my PC so I add the parent path to the IDE.我不想重新启动我的电脑,所以我将父路径添加到 IDE。 Right click on project.右键单击项目。

enter image description here在此处输入图像描述

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

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