简体   繁体   English

草莓perl:没有File :: Tail.pm。 CPAN无法安装模块

[英]strawberry perl: no File::Tail.pm. CPAN failed to install the module

I'm using strawberry perl to tail a file using use File::Tail . 我正在使用草莓perl来使用File::Tail来拖尾文件。

I got the error message of the following: 我收到以下错误消息:

Can't locate File/Tail.pm in @INC (@INC contains: c:\\strawberry\\perl\\lib C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/ lib .) at tailing.perl line 5. BEGIN failed--compilation aborted at tailing.perl line 5. 无法找到文件/ Tail.pm在@公司(@公司包含:C:\\草莓\\ perl的\\ lib文件C:/草莓/ perl的/网站/ lib目录C:/草莓/ perl的/供应商/ lib目录C:/草莓/ perl / lib。)在tailing.perl第5行.BEGIN失败 - 编译在tailing.perl第5行中止。

Three packages contains lib: 三个包包含lib:

  • c:\\strawberry\\perl\\lib
  • C:\\strawberry\\perl\\site\\lib
  • C:\\strawberry\\perl\\vendor\\lib

where c:\\strawberry\\perl is the root directory of perl installation. 其中c:\\strawberry\\perl是perl安装的根目录。
I checked all the three packages, but couldn't find File/Tail.pm . 我检查了所有三个包,但找不到File/Tail.pm

Used cpan install, but the installation failed. 使用cpan install,但安装失败。

The current File::Tail distribution on CPAN has never passed its test suite on Windows . CPAN上的当前File::Tail发行版从未在Windows上通过其测试套件 Steffen Mueller submitted a patch for Windows 5 years ago, but it has never been incorporated into the distribution on CPAN. Steffen Mueller 5年前为Windows 提交了一个补丁 ,但它从未被纳入CPAN的发行版。

His patch is available here , and hallelujah, it works for me. 他的补丁可以在这里找到 ,哈利路亚,它对我有用。 Just unpack it anywhere and run the conventional 只需在任何地方拆开包装并运行常规

perl Makefile.PL
dmake
dmake test
dmake install

That's the great thing about Strawberry Perl. 这是关于Strawberry Perl的好消息。

C:\Users\me > cpan File::Tail

Of course, I got: 当然,我得到了:

Test Summary Report
-------------------
t/10open.t       (Wstat: 0 Tests: 6 Failed: 4)
  Failed tests:  3-6
t/20tail.t       (Wstat: 0 Tests: 3 Failed: 3)
  Failed tests:  1-3
  Parse errors: Bad plan.  You planned 7 tests but ran 3.
t/30name_change.t (Wstat: 0 Tests: 1 Failed: 1)
  Failed test:  1
  Parse errors: Bad plan.  You planned 2 tests but ran 1.
Files=3, Tests=10, 32 wallclock secs ( 0.03 usr +  0.09 sys =  0.12 CPU)
Result: FAIL
Failed 3/3 test programs. 8/10 subtests failed.
dmake.EXE:  Error code 255, while making 'test_dynamic'
  MGRABNAR/File-Tail-0.99.3.tar.gz
  C:\strawberry\c\bin\dmake.EXE test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MGRABNAR/File-Tail-0.99.3.tar.gz
Running make install
  make test had returned bad status, won't install without force

So I wouldn't recommend it. 所以我不推荐它。

Not all modules are part of the standard module set. 并非所有模块都是标准模块集的一部分。 You should check the Perldoc Perl documentation. 您应该检查Perldoc Perl文档。 This contains all the standard Perl modules. 它包含所有标准 Perl模块。 If a module isn't in there, you have to install it. 如果模块不在那里,则必须安装它。

As Axeman said, you can use the cpan command to install any module. 正如Axeman所说,您可以使用cpan命令安装任何模块。 Just type in cpan at the command prompt and when you get the cpan> prompt, type in install File::Tail . 只需在命令提示符下键入cpan ,当您获得cpan>提示符时,键入install File::Tail It should install everything for you automatically including prerequisites. 它应该自动为您安装所有内容,包括先决条件。

You can also look at module reviews at CPAN Ratings . 您还可以查看CPAN评级的模块评论。

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

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