2

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

4

1 回答 1

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 生成文件.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
于 2012-10-08T05:36:04.587 回答