Perl无法在@INC中find模块

我正在运行Centos 6.4和Perl 5.10。 我有使用DateTime模块的短脚本。 然而,当我运行我的脚本时,我得到以下错误消息,告诉我各种模块不能位于,因为他们不在库path。

 Can't locate Params/Validate.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/lib64/perl5/DateTime/Duration.pm line 11. BEGIN failed--compilation aborted at /usr/lib64/perl5/DateTime/Duration.pm line 11. Compilation failed in require at /usr/lib64/perl5/DateTime.pm line 45. BEGIN failed--compilation aborted at /usr/lib64/perl5/DateTime.pm line 45. Compilation failed in require at ./jr_fix_western_filestore.perl line 39. BEGIN failed--compilation aborted at ./jr_fix_western_filestore.perl line 39. 

所有这些软件包已经通过yum安装。 例如yum install perl-Params-Validate.x86_64yum install perl-DateTime.x86_64 。 如果yum安装不把这些模块放在@INC中?

我也尝试通过cpan安装软件包,但是这似乎想要首先下载大量的依赖关系,并且不可避免地会失败。

  CPAN.pm: Going to build D/DR/DROLSKY/DateTime-1.03.tar.gz Can't locate Module/Build.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Build.PL line 5. BEGIN failed--compilation aborted at Build.PL line 5. Warning: No success on command[/usr/bin/perl Build.PL --installdirs site] Warning (usually harmless): 'YAML' not installed, will not store persistent state DROLSKY/DateTime-1.03.tar.gz /usr/bin/perl Build.PL --installdirs site -- NOT OK Running Build test Make had some problems, won't test Running Build install Make had some problems, won't install Could not read '/root/.cpan/build/DateTime-1.03-Brpqo5/META.yml'. Falling back to other methods to determine prerequisites Warning: CPAN.pm discovered Module::Build as undeclared prerequisite. Adding it now as such. 

当我尝试在cpan中安装Module :: Build时,出现以下错误

 Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: OVID/Test-Harness-3.28.tar.gz : make_test NO MSCHWERN/Test-Simple-0.98.tar.gz : make_test NO JPEACOCK/version-0.9902.tar.gz : make_test NO BOBTFISH/Module-Metadata-1.000014.tar.gz : make_test NO DAGOLDEN/CPAN-Meta-YAML-0.008.tar.gz : make_test NO MAKAMAKA/JSON-PP-2.27202.tar.gz : make_test NO DAGOLDEN/Parse-CPAN-Meta-1.4404.tar.gz : make_test NO DAGOLDEN/CPAN-Meta-Requirements-2.122.tar.gz : make_test NO DAGOLDEN/CPAN-Meta-2.130880.tar.gz : make_test NO DAGOLDEN/Perl-OSType-1.003.tar.gz : make_test NO JESSE/Locale-Maketext-Simple-0.21.tar.gz : make_test NO BINGOS/Params-Check-0.36.tar.gz : make_test NO BINGOS/Module-Load-0.24.tar.gz : make_test NO BINGOS/Module-CoreList-2.91.tar.gz : make_test NO BINGOS/Module-Load-Conditional-0.54.tar.gz : make_test NO BINGOS/IPC-Cmd-0.80.tar.gz : make_test NO DAGOLDEN/ExtUtils-CBuilder-0.280205.tar.gz : make_test NO LEONT/Module-Build-0.4005.tar.gz : make NO 

任何指针?


rpm -ql perl-Params-Validate返回

 /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Attribute /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Attribute/Params /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Attribute/Params/Validate.pm /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Params /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Params/Validate.pm /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Params/ValidatePP.pm /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Params/ValidateXS.pm /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/Params /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/Params/Validate /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/Params/Validate/Validate.bs /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/Params/Validate/Validate.so /usr/share/doc/perl-Params-Validate-0.95 /usr/share/doc/perl-Params-Validate-0.95/Changes /usr/share/doc/perl-Params-Validate-0.95/LICENSE /usr/share/doc/perl-Params-Validate-0.95/MANIFEST /usr/share/doc/perl-Params-Validate-0.95/META.yml /usr/share/doc/perl-Params-Validate-0.95/README /usr/share/doc/perl-Params-Validate-0.95/TODO /usr/share/man/man3/Attribute::Params::Validate.3pm.gz /usr/share/man/man3/Params::Validate.3pm.gz /usr/share/man/man3/Params::ValidatePP.3pm.gz /usr/share/man/man3/Params::ValidateXS.3pm.gz 

我不确定这些path是否被@INCsearch到

但是, locate Validate.pm不会返回任何内容

Solutions Collecting From Web of "Perl无法在@INC中find模块"

似乎你已经为RHEL / Centos 4配置了RPMforge,但是你使用的是Centos 6:

安装:perl-Params-Validate x86_64 0.95-1。 el4 .rf

按照从这个网站的指示,并做全球远程升级来修复损坏的依赖关系(我很幸运,重新安装将不需要)。 然后安装你想要的perl包。

搜索和安装

  yum install perl-CGI 

这为我工作。

我迟到了讨论,但也遇到了同样的问题。 这是我如何解决它。

CPAN给了我相同的错误,因为在yum下安装了一个旧版本。 我通过百胜更新了包装,并能够前进。