繁体   English   中英

无法使用CPAN安装Perl模块(带有XAMPP的Windows XP Server)

[英]Unable To Install Perl Modules Using CPAN (Windows XP Server with XAMPP)

我目前有一个带有XAMPP的Windows XP Pro SP3服务器。 我今天早些时候下载了XAMPP的Perl插件,并且安装没有问题。 安装后,我能够使用浏览器转到服务器上的.pl文件,并且它们可以正确执行。 我现在正在尝试使用CPAN安装一些Perl模块,并且在此过程中收到一些错误消息,并且这些模块无法安装。 我不熟悉Perl,不胜感激。 以下是我尝试安装模块时发生的情况:

cpan[4]> install Task::Kensho
Running install for module 'Task::Kensho'
Running make for A/AP/APEIRON/Task-Kensho-0.31.tar.gz
CPAN: LWP::UserAgent loaded ok (v5.817)

I would like to connect to one of the following sites to get 'authors/id/A/AP/AP
EIRON/Task-Kensho-0.31.tar.gz':

 http://www.perl.org/CPAN/
 ftp://ftp.perl.org/pub/CPAN/

Is it OK to try to connect to the Internet? [yes] yes
Fetching with LWP:
  http://www.perl.org/CPAN/authors/id/A/AP/APEIRON/Task-Kensho-0.31.tar.gz
CPAN: Digest::SHA loaded ok (v5.45)
Fetching with LWP:
  http://www.perl.org/CPAN/authors/id/A/AP/APEIRON/CHECKSUMS
Checksum for \.cpan\sources\authors\id\A\AP\APEIRON\Task-Kensho-0.31.tar.gz ok
Scanning cache \.cpan\build for sizes
............................................................................DONE

The system cannot find the path specified.
Uncompressed \.cpan\sources\authors\id\A\AP\APEIRON\Task-Kensho-0.31.tar.gz succ
essfully
Using Tar:"C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\bin\tar.EXE" xvf "
Task-Kensho-0.31.tar":
The system cannot find the path specified.
Couldn't untar Task-Kensho-0.31.tar
CPAN: File::Temp loaded ok (v0.18)
Package seems to come without Makefile.PL.
  (The test -f "\.cpan\build\APEIRON-zQFric\Makefile.PL" returned false.)
  Writing one on our own (setting NAME to TaskKensho)
  Had problems unarchiving. Please build manually
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
Failed during this command:
 APEIRON/Task-Kensho-0.31.tar.gz              : unwrapped NO -- untar failed

此特定行:

Using Tar:"C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\bin\tar.EXE" xvf "

正在引用我的系统上没有的文件和目录。 我不确定这样做的重要性,但我想指出这一点。

任何帮助是极大的赞赏!

更新:@daxim,谢谢您的建议。 我安装了Strawberry Perl,并能够使用cpan install [module name]安装要运行的脚本的所有必需模块。 但是,当我使用Web浏览器转到脚本时,该脚本无法编译,并且在Apache错误日志中得到了该脚本:

[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 200.\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1]  at C:/strawberry/perl/site/lib/XML/LibXML.pm line 154\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] BEGIN failed--compilation aborted at C:/strawberry/perl/site/lib/XML/LibXML.pm line 154.\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] Compilation failed in require at C:/strawberry/perl/site/lib/XML/LibXML/SAX.pm line 17.\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] BEGIN failed--compilation aborted at C:/strawberry/perl/site/lib/XML/LibXML/SAX.pm line 17.\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] Compilation failed in require at (eval 27) line 1.\r

我确实安装了XML :: LibXML以及其他必需的模块。 再次感谢任何帮助!

我为此工作了2天。

问题实际上是tar(和其他基于Unix的程序)的全局路径设置不正确。 如果在Strawberry Perl之前安装了Git或Cygwin之类的东西,就会发生这种情况,因为它们中包含Perl,这会导致这个问题。

诊断

运行cpan -J

检查tar是否设置为错误的路径/usr/bin/tar

如果是...

在命令行中:

perl -MCPAN -e shell

o conf init /tar/

从那里输入到Git或Cygwin中tar程序的正确FULL路径:

C:\\\\cygwin64\\\\bin\\tar.exe

之后,当询问您是否要使用外部命令而不是Perl内置模块时,请输入no

我也在Strawberry Perl中遇到同样的错误消息。

无法加载'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll'

我仅针对XML :: LibXML看到此错误。 草莓Perl的XML :: LibXML打包的DLL版本可能存在问题,但我不确定。

我终于安装了Activestate Perl,并使用了Perl随附的PPM工具来安装缺少的软件包,一切正常。 您也可以在Windows中尝试PPM GUI:

开始菜单→所有程序→ActivePerl 5.14.2 Build 1402→Perl软件包管理器。

暂无
暂无

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

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