gpt4 book ai didi

perl - 为什么安装 Scrappy 时 CPAN 安装失败?

转载 作者:行者123 更新时间:2023-12-04 05:29:52 26 4
gpt4 key购买 nike

我知道它缺少依赖项,但我认为 CPAN 会自动安装所有依赖模块。这是错误:

Test Summary Report
-------------------
t/00_load_scrappy.t (Wstat: 65280 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 255
Parse errors: Bad plan. You planned 12 tests but ran 1.
t/00_test_function_back.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/00_test_function_content.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/00_test_function_control.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/00_test_function_cookies.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/00_test_function_crawl.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/00_test_function_debug.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/00_test_function_domain.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/00_test_function_download.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/01_load_scrappy.t (Wstat: 65280 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 255
Parse errors: Bad plan. You planned 8 tests but ran 1.
Files=39, Tests=2, 1 wallclock secs ( 0.08 usr 0.08 sys + 0.85 cusr 0.15 csys = 1.16 CPU)
Result: FAIL
Failed 10/39 test programs. 2/2 subtests failed.
make: *** [test_dynamic] Error 255
AWNCORP/Scrappy-0.94112090.tar.gz
7 dependencies missing (String::TT,WWW::Mechanize,Web::Scraper,YAML::Syck,Template,HTML::TreeBuilder,Moose); additionally test harness failed
make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports AWNCORP/Scrappy-0.94112090.tar.gz
Running make install
make test had returned bad status, won't install without force
Could not read metadata file. Falling back to other methods to determine prerequisites
Failed during this command:
ROBIN/PadWalker-1.96.tar.gz : make NO
ABW/Template-Toolkit-2.24.tar.gz : make NO
BOBTFISH/String-TT-0.03.tar.gz : make_test NO 2 dependencies missing (PadWalker,Template); additionally test harness failed
GAAS/HTML-Parser-3.69.tar.gz : make NO
CJM/HTML-Tree-5.03.tar.gz : make_test NO 2 dependencies missing (HTML::Parser,HTML::Entities); additionally test harness failed
MIROD/HTML-TreeBuilder-XPath-0.14.tar.gz : make_test NO one dependency not OK (HTML::TreeBuilder); additionally test harness failed
GAAS/libwww-perl-6.04.tar.gz : make_test NO 2 dependencies missing (HTML::HeadParser,HTML::Entities); additionally test harness failed
MIYAGAWA/Web-Scraper-0.36.tar.gz : make_test NO 4 dependencies missing (HTML::TreeBuilder::XPath,HTML::Entities,HTML::TreeBuilder,LWP); additionally test harness failed
DOY/Package-Stash-XS-0.25.tar.gz : make NO
DROLSKY/Class-Load-XS-0.04.tar.gz : make NO
DOY/Moose-2.0604.tar.gz : make NO
GAAS/HTML-Form-6.03.tar.gz : make_test NO one dependency not OK (HTML::TokeParser); additionally test harness failed
JESSE/WWW-Mechanize-1.72.tar.gz : make_test NO 7 dependencies missing (HTML::Form,LWP::UserAgent,HTML::TokeParser,HTML::Parser,HTML::HeadParser,HTML::TreeBuilder,LWP); additionally test harness failed
TODDR/YAML-Syck-1.21.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status 512
AWNCORP/Scrappy-0.94112090.tar.gz : make_test NO 7 dependencies missing (String::TT,WWW::Mechanize,Web::Scraper,YAML::Syck,Template,HTML::TreeBuilder,Moose); additionally test harness failed

然后我尝试单独安装一个依赖模块:
cpan[2]> install PadWalker
Running install for module 'PadWalker'
Running make for R/RO/ROBIN/PadWalker-1.96.tar.gz
Has already been unwrapped into directory /root/.cpan/build/PadWalker-1.96-n6C9km
Could not make: Unknown error
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible

有人能指出我正确的方向吗?我是 root,到目前为止它是最新的 Ubuntu 12.04.1。

最佳答案

可以使用 CPAN 安装 Scrappy。在我的情况下,只有 Moose 必须被强制(失败的 1/382 测试程序。0/18150 子测试失败)。

cpan[6]> force install Moose
[...]

cpan[7]> install Scrappy
Running install for module 'Scrappy'
Running make for A/AW/AWNCORP/Scrappy-0.94112090.tar.gz

[...]
Installing /home/david/perl5/bin/scrappy
Appending installation info to /home/david/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod

AWNCORP/Scrappy-0.94112090.tar.gz
/usr/bin/make install -- OK

您应该尝试手动安装 PadWalker 以找出背后的原因 Could not make: Unknown error .

就我而言,PadWalker 可以从 ~/.cpan/build/PadWalker-1.96-XW0Mq2 安装。如下:

perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for PadWalker
Writing MYMETA.yml

制作
cp PadWalker.pm blib/lib/PadWalker.pm
/usr/bin/perl /usr/share/perl/5.14/ExtUtils/xsubpp -typemap /usr/share/perl/5.14/ExtUtils/typemap PadWalker.xs > PadWalker.xsc && mv PadWalker.xsc PadWalker.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=\"1.96\" -DXS_VERSION=\"1.96\" -fPIC "-I/usr/lib/perl/5.14/CORE" PadWalker.c
[...]
chmod 755 blib/arch/auto/PadWalker/PadWalker.so
cp PadWalker.bs blib/arch/auto/PadWalker/PadWalker.bs
chmod 644 blib/arch/auto/PadWalker/PadWalker.bs
Manifying blib/man3/PadWalker.3pm

做测试
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0,     'blib/lib', 'blib/arch')" t/*.t
t/closure.t ... ok
t/dm.t ........ ok
[...]
Result: PASS

安装
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/david/perl5/man/man3/PadWalker.3pm
Appending installation info to /home/david/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod

关于perl - 为什么安装 Scrappy 时 CPAN 安装失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12775094/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com