Perl可以';t安装Net::SSL

Perl可以';t安装Net::SSL,perl,ubuntu,ssl,Perl,Ubuntu,Ssl,为了安装RT4.2,我尝试安装Net::SSL,但没有成功。这是输出:(Ubuntu服务器12.04,perl 5.14.2) 当我选择N个不测试连接的选择时,也不会成功 sudo cpan install Net::SSL [sudo] password for hengaini: Going to read '/home/hengaini/.cpan/Metadata' Database was generated on Thu, 20 Feb 2014 09:41:02 GMT Ru

为了安装RT4.2,我尝试安装Net::SSL,但没有成功。这是输出:(Ubuntu服务器12.04,perl 5.14.2)

当我选择N个不测试连接的选择时,也不会成功

sudo cpan install Net::SSL
[sudo] password for hengaini: 
Going to read '/home/hengaini/.cpan/Metadata'
  Database was generated on Thu, 20 Feb 2014 09:41:02 GMT
Running install for module 'Net::SSL'
Running make for N/NA/NANIS/Crypt-SSLeay-0.64.tar.gz
Checksum for /home/hengaini/.cpan/sources/authors/id/N/NA/NANIS/Crypt-SSLeay-0.64.tar.gz ok

  CPAN.pm: Going to build N/NA/NANIS/Crypt-SSLeay-0.64.tar.gz

The test suite can attempt to connect to public servers to ensure that the
code is working properly. If you are behind a strict firewall or have no
network connectivity, these tests may fail (through no fault of the code).
Do you want to run the live tests (y/N)? [N] y
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -lssl32
Warning (mostly harmless): No library found for -lssleay32
Warning (mostly harmless): No library found for -leay32
Generating a Unix-style Makefile
Writing Makefile for Crypt::SSLeay
Writing MYMETA.yml and MYMETA.json
cp lib/Crypt/SSLeay/X509.pm blib/lib/Crypt/SSLeay/X509.pm
cp lib/Net/SSL.pm blib/lib/Net/SSL.pm
cp lib/Crypt/SSLeay/MainContext.pm blib/lib/Crypt/SSLeay/MainContext.pm
cp lib/Crypt/SSLeay/Conn.pm blib/lib/Crypt/SSLeay/Conn.pm
cp lib/Crypt/SSLeay/CTX.pm blib/lib/Crypt/SSLeay/CTX.pm
cp SSLeay.pm blib/lib/Crypt/SSLeay.pm
cp lib/Crypt/SSLeay/Err.pm blib/lib/Crypt/SSLeay/Err.pm
/usr/bin/perl /usr/share/perl/5.14/ExtUtils/xsubpp  -typemap /usr/share/perl/5.14/ExtUtils/typemap -typemap typemap  SSLeay.xs > SSLeay.xsc && mv SSLeay.xsc SSLeay.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"0.64\" -DXS_VERSION=\"0.64\" -fPIC "-I/usr/lib/perl/5.14/CORE"   SSLeay.c
rm -f blib/arch/auto/Crypt/SSLeay/SSLeay.so
LD_RUN_PATH="/lib/x86_64-linux-gnu" cc  -shared -O2 -g -L/usr/local/lib -fstack-protector SSLeay.o  -o blib/arch/auto/Crypt/SSLeay/SSLeay.so    \
       -lz -lssl -lcrypto   \

chmod 755 blib/arch/auto/Crypt/SSLeay/SSLeay.so
/usr/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- SSLeay.bs blib/arch/auto/Crypt/SSLeay/SSLeay.bs 644
Manifying blib/man3/Crypt::SSLeay.3pm
Manifying blib/man3/Net::SSL.3pm
  NANIS/Crypt-SSLeay-0.64.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-basic.t .... ok     
t/01-connect.t .. 1/8 
#   Failed test 'Net::SSL->new'
#   at t/01-connect.t line 28.
# Connect failed: connect: 拒绝连接; 拒绝连接 at t/01-connect.t line 11.
# Looks like you failed 1 test of 8.
t/01-connect.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/8 subtests 
    (less 7 skipped subtests: 0 okay)
t/02-live.t ..... # Reading configuration from 'test.config' on linux
# network_tests : 1
t/02-live.t ..... 1/? # [RT #73755] Cheat by disabling LWP::UserAgent host verification
t/02-live.t ..... ok   

Test Summary Report
-------------------
t/01-connect.t (Wstat: 256 Tests: 8 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=3, Tests=28,  2 wallclock secs ( 0.03 usr  0.00 sys +  0.53 cusr  0.30 csys =  0.86 CPU)
Result: FAIL
Failed 1/3 test programs. 1/28 subtests failed.
make: *** [test_dynamic] 错误 255
  NANIS/Crypt-SSLeay-0.64.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports NANIS/Crypt-SSLeay-0.64.tar.gz
Running make install
  make test had returned bad status, won't install without force

更好的是,我希望您使用的是基于or的环境,因为您至少已经费心安装了
cpan
,而不是依赖默认的软件包

因此,您的系统上似乎缺少SSL的库和标头,请通过以下方式修复此问题:

sudo apt-get install libssl-dev

如果您还没有,请使用上面链接的其中一种方法设置您的环境,并寻找一个非常有用的工具来补充这两种方法。

您的问题是,构建后的测试没有成功,并且此文件t/01 connect.t第11行中出现了错误

eval {
    $sock = Net::SSL->new(
        PeerAddr => '127.0.0.1',
        PeerPort => 443,
        Timeout  => 3,
    );
};

我可以假设某个进程已经在127.0.0.1 443端口上侦听。尝试停止它,然后按您希望的方式重新安装。测试应该始终通过。

您也可以使用
apt-get
安装Perl模块
apt cache search net ssl
查找包名。不运行实时测试的输出是什么?