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

时间:2012-10-08 03:54:02

标签: perl makefile install cpan

我知道它缺少依赖项,但我认为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。

1 个答案:

答案 0 :(得分:3)

可以使用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

make install

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