我编写了一个perl脚本,它在我的环境中运行良好,但在我的客户端环境中它失败了:
Can't locate loadable object for module Math::Pari in @INC (@INC contains: Error-0.17020/lib JSON-2.57/lib URI-1.60 libwww-perl-5.836/lib Net-Address-IP-Local-0.1.2/lib Math-GMP-2.06/ Net- SSH-Perl-1.35/lib/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util.pm line 56, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex/DH1.pm line 10, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl.pm line 52, <GEN0> line 1.
the user: ll was successfully added to the automation machine.notroot@ubuntu:~/autom ation$ vim install.pl
我试图添加 使用lib'Math'; 包含Math-Pari-2.0305_01080605模块的内容,但没有运气:/
我不希望我的客户自己安装cpan软件包 - 它应该是完全独立于环境的产品。
我更愿意避免从“Net-SSH-Perl-1.35”切换,因为我的代码的大部分都依赖于它。
提前10倍!更新: 我正在重写更新以澄清事情:
我的出发点是以下库:
use lib 'Net-SSH-Perl-1.35/lib/';
use lib 'Math-GMP-2.06/';
use lib 'Net-Address-IP-Local-0.1.2/lib';
use lib 'libwww-perl-5.836/lib';
use lib 'URI-1.60';
use lib 'JSON-2.57/lib';
use lib 'Error-0.17020/lib';
use Net::SSH::Perl;
use LWP::Simple;
use JSON qw( decode_json );
use POSIX qw/strftime/;
use Net::Address::IP::Local;
输出以下内容:
Can't locate Math/Pari.pm in @INC (@INC contains: Error-0.17020/lib JSON-2.57/lib URI-1.60 libwww- perl-5.836/lib Net-Address-IP-Local-0.1.2/lib Math-GMP-2.06/ Net-SSH-Perl-1.35/lib/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at Net-SSH-Perl- 1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util.pm line 56, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex/DH1.pm line 10 , <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1 .
BEGIN失败 - 编译中止......
为了解决这个问题,我添加了下一个声明:
使用lib'Math-Pari-2.010709';
并将错误更改为:
Can't locate loadable object for module Math::Pari in @INC (@INC contains: Math-Pari-2.010709 Error- 0.17020/lib JSON-2.57/lib URI-1.60 libwww-perl-5.836/lib Net-Address-IP-Local-0.1.2/lib Math-GMP-2.06/ Net-SSH-Perl-1.35/lib/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at Net-SSH-Perl- 1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util.pm line 56, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex/DH1.pm line 10, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1....
这是Math-Pari-2.010709的内容:
drwxr-xr-x 3 notroot notroot 4096 May 7 14:38 ./
drwxr-xr-x 11 notroot notroot 4096 May 7 21:30 ../
drwxr-xr-x 7 notroot notroot 4096 May 7 14:38 Math/
数学-帕里-2.010709 /数学:
total 240
drwxr-xr-x 7 notroot notroot 4096 May 7 14:38 ./
drwxr-xr-x 3 notroot notroot 4096 May 7 14:38 ../
-r--r--r-- 1 notroot notroot 27440 Oct 25 2006 Changes
-r--r--r-- 1 notroot notroot 17793 Feb 1 2004 func_codes.h
-r--r--r-- 1 notroot notroot 8676 Aug 9 2006 INSTALL
drwxr-xr-x 2 notroot notroot 4096 Oct 25 2006 libPARI/
-r--r--r-- 1 notroot notroot 7573 Oct 25 2006 Makefile.PL
-r--r--r-- 1 notroot notroot 780 Nov 11 2005 MANIFEST
-r--r--r-- 1 notroot notroot 297 Oct 25 2006 META.yml
-r--r--r-- 1 notroot notroot 1322 Aug 23 2006 PariInit.pm
-r--r--r-- 1 notroot notroot 35680 Oct 25 2006 Pari.pm
-r--r--r-- 1 notroot notroot 79499 Oct 18 2006 Pari.xs
drwxr-xr-x 2 notroot notroot 4096 Oct 25 2006 patches/
-r--r--r-- 1 notroot notroot 4286 Jan 30 2004 README
drwxr-xr-x 2 notroot notroot 4096 Oct 25 2006 t/
drwxr-xr-x 2 notroot notroot 4096 Oct 25 2006 test_eng/
-r--r--r-- 1 notroot notroot 1142 Jan 20 2005 TODO
-r--r--r-- 1 notroot notroot 1361 Jul 8 2001 typemap
drwxr-xr-x 3 notroot notroot 4096 Oct 25 2006 utils/
我需要说数学文件夹最初并不存在于Math-Pari-2.010709中,所以我创建了它并将Math-Pari-2.010709内容移入其中,以便perl正在寻找位置。
在这个阶段我添加了: 使用Math :: Pari
但似乎并没有产生差异:
Can't locate loadable object for module Math::Pari in @INC (@INC contains: Math-Pari-2.010709 Error- 0.17020/lib JSON-2.57/lib URI-1.60 libwww-perl-5.836/lib Net-Address-IP-Local-0.1.2/lib Math-GMP-2.06/ Net-SSH-Perl-1.35/lib/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./install.pl line 24
Compilation failed in require at ./install.pl line 24.
BEGIN failed--compilation aborted at ./install.pl line 24.
我总结了迄今为止的所有尝试。
我将不胜感激任何帮助!
答案 0 :(得分:4)
有许多CPAN发行版必须经过构建和安装过程;你不能只是从CPAN解压缩文件并将perl指向它们。
Math :: Pari是一个;它必须编译绑定到外部库(也必须存在)。
你对这种做法不太满意。
答案 1 :(得分:0)
您可以切换到与大多数Net :: SSH :: Perl在API级别兼容的Net::OpenSSH::Compat::Perl,并且安装依赖项的次数越来越少。
为了支持密码身份验证和OpenSSH ssh
二进制文件,它只有非纯粹的Perl依赖项才需要IO::Pty,这些二进制文件已经安装在Linux和BSD系统的机器上,或者作为一个包提供对于Solaris以及其他几个unixen。