如何在osx上安装perl评论家?

时间:2013-09-23 12:14:55

标签: perl perl-critic

我尝试下载,解压缩,按照说明操作:

  tar -zxf Perl-Critic-1.107_001.tar.gz
    cd Perl-Critic-1.107_001
    perl Makefile.PL
    make
    make test
    make install

当我进入制作步骤时,我得到:

/usr/bin/perl "-Iblib/arch" "-Iblib/lib" t/Variables/RequireLocalizedPunctuationVars.run.PL t/Variables/RequireLocalizedPunctuationVars.run
Can't locate B/Keywords.pm in @INC (@INC contains: blib/arch blib/lib /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at t/Variables/RequireLocalizedPunctuationVars.run.PL line 16.
BEGIN failed--compilation aborted at t/Variables/RequireLocalizedPunctuationVars.run.PL line 16.
make: *** [t/Variables/RequireLocalizedPunctuationVars.run] Error 2

我怀疑是因为我错过了依赖。我也发现了这个任务 - https://metacpan.org/pod/Task::Perl::Critic这似乎很有意思,但它没有关于如何运行的指示。

---编辑 跑完后 -      sudo cpan Task :: Perl :: Critic

我得到了这些结果:

Test Summary Report
-------------------
t/20_policies.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/pod.t         (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=5, Tests=5,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.08 cusr  0.01 csys =  0.12 CPU)
Result: FAIL
Failed 2/5 test programs. 0/5 subtests failed.
make: *** [test_dynamic] Error 255
  MARCELO/Perl-Critic-Itch-0.07.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MARCELO/Perl-Critic-Itch-0.07.tar.gz
Running make install
  make test had returned bad status, won't install without force
Running Build for T/TH/THALJEF/Task-Perl-Critic-1.008.tar.gz
  Has already been unwrapped into directory /Users/joelnylund/.cpan/build/Task-Perl-Critic-1.008-g5bmDk

  CPAN.pm: Going to build T/TH/THALJEF/Task-Perl-Critic-1.008.tar.gz

Warning: Prerequisite 'Perl::Critic::PetPeeves::JTRAMMELL => 0.01' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'JTRAMMELL/Perl-Critic-PetPeeves-JTRAMMELL-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Dynamic => 0.05' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Perl-Critic-Dynamic-0.05.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Test::Perl::Critic::Progressive => 0.03' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Test-Perl-Critic-Progressive-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Compatibility => 1.000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-Compatibility-1.001.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Swift => 1.000003' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-Swift-v1.0.3.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Lax => 0.007' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'RJBS/Perl-Critic-Lax-0.009.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Bangs => 1.00' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'PETDANCE/Perl-Critic-Bangs-1.10.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::More => 1.000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-More-1.000.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Tics => 0.005' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'RJBS/Perl-Critic-Tics-0.007.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic => 1.117' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Perl-Critic-1.118.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Pulp => 3' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'KRYDE/Perl-Critic-Pulp-80.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Storable => 0' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'MATTD/Perl-Critic-Storable-0.01.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Test::Perl::Critic => 1.02' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Test-Perl-Critic-1.02.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'criticism => 1.02' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/criticism/criticism-1.02.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::StricterSubs => 0.03' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/strictersubs/Perl-Critic-StricterSubs-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Nits => 1.000000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'KCOWGILL/Perl-Critic-Nits-v1.0.0.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Itch => 0' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'MARCELO/Perl-Critic-Itch-0.07.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Building Task-Perl-Critic
  THALJEF/Task-Perl-Critic-1.008.tar.gz
  ./Build -- OK
Running Build test
t/00_load.t .......... 1/1 # Testing Task::Perl::Critic 1.008
t/00_load.t .......... ok   
t/98_pod_syntax.t .... ok   
t/99_pod_coverage.t .. skipped: Test::Pod::Coverage 1.00 requried to test POD
All tests successful.
Files=3, Tests=2,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.07 cusr  0.02 csys =  0.12 CPU)
Result: PASS
  THALJEF/Task-Perl-Critic-1.008.tar.gz
Tests succeeded but 18 dependencies missing (Perl::Critic::Storable,Perl::Critic::PetPeeves::JTRAMMELL,Perl::Critic::Dynamic,Test::Perl::Critic::Progressive,Test::Perl::Critic,Perl::Critic::Compatibility,Perl::Critic::Swift,Perl::Critic::Moose,Perl::Critic::Lax,criticism,Perl::Critic::Bangs,Perl::Critic::More,Perl::Critic::StricterSubs,Perl::Critic::Tics,Perl::Critic::Nits,Perl::Critic,Perl::Critic::Pulp,Perl::Critic::Itch)
  THALJEF/Task-Perl-Critic-1.008.tar.gz
  [dependencies] -- NA
Running Build install
  make test had returned bad status, won't install without force

3 个答案:

答案 0 :(得分:8)

您可能不想安装Task::Perl::Critic。它包含一系列插件以及其他作者编写的其他策略。其中一些将相互冲突(即遵守一种手段违反另一种手段)。根据您在上面显示的错误消息,这些插件是测试失败的来源,而不是Perl::Critic本身。

单独安装Perl::Critic就足够了。正如其他人所建议的那样,使用cpan实用程序:

sudo cpan Perl::Critic

这会照顾你的所有依赖。

答案 1 :(得分:0)

您可能需要先安装 Perl。

在大苏尔,我注意到缺少 keywords.h,因此 force install B::Keywords

这对我有用:

    # cpan
    install CPAN
    reload cpan
    install Term::ReadLine::Perl
    install Log::Log4perl
    upgrade
    force install B::Keywords
    install Perl::Critic

答案 2 :(得分:-4)

好吧,从我做过的评论来看,可怕的建议似乎是唯一有效的建议:

 cpan
 force install Task::Perl::Critic

它似乎到目前为止工作..我已经审查了十几个perl文件,结果似乎是我正在寻找...