我正在尝试安装一个模块来处理HHMMSS格式的时间-只是为了找到基本的时差等等。时间:: ParseDate看起来很合适,但是我在安装它时遇到了一些麻烦。

我在为MSWin32-x64-multi-thread构建的perl 5,版本16,版本3(v5.16.3)上。

命令:

cpan Time::ParseDate

退货
Set up gcc environment - 4.4.7 20111023 (prerelease) [svn/rev.180339 - mingw-w64/oz]
Checking if your kit is complete...
Looks good
Writing Makefile for Time::ParseDate
Writing MYMETA.yml and MYMETA.json
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Cannot copy 'lib/Time/JulianDay.pm' to 'blib\lib\Time\JulianDay.pm': No such     file or directory
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1.
dmake.exe:  Error code 130, while making 'pm_to_blib'
  MUIR/modules/Time-ParseDate-2013.0920.tar.gz
  C:\Dwimperl\c\bin\dmake.exe -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible

有人能确切解释出什么问题吗?好像我缺少lib/Time/JulianDay.pm,但是为什么呢?我是否需要更新Perl版本或Cpan版本?

我删除了自动运行注册表项,然后重试了安装。我有:
CPAN: Term::ANSIColor loaded ok (v4.02)
CPAN: Storable loaded ok (v2.34)
Reading 'C:\Perl64\cpan\Metadata'
  Database was generated on Tue, 05 Nov 2013 20:53:02 GMT
 Running install for module 'Time::ParseDate'
 Running make for M/MU/MUIR/modules/Time-ParseDate-2013.0920.tar.gz
 CPAN: Digest::SHA loaded ok (v5.84)
   CPAN: Compress::Zlib loaded ok (v2.06)
 Checksum for C:\Perl64\cpan\sources\authors\id\M\MU\MUIR\modules\Time-ParseDate-2013.0920.tar.gz ok
 CPAN: Archive::Tar loaded ok (v1.90)
 Time-ParseDate-2013.0920/
 etc...
Time-ParseDate-2013.0920/t/datetime.t
 CPAN: File::Temp loaded ok (v0.22)
 CPAN: Parse::CPAN::Meta loaded ok (v1.4404)
CPAN: CPAN::Meta loaded ok (v2.120921)
 CPAN: Module::CoreList loaded ok (v2.80)

 CPAN.pm: Building M/MU/MUIR/modules/Time-ParseDate-2013.0920.tar.gz

Set up gcc environment - 4.4.7 20111023 (prerelease) [svn/rev.180339 - mingw-w64/oz]
Checking if your kit is complete...
Looks good
Writing Makefile for Time::ParseDate
Writing MYMETA.yml and MYMETA.json
cp lib/Time/JulianDay.pm blib\lib\Time\JulianDay.pm
cp lib/Time/CTime.pm blib\lib\Time\CTime.pm
cp lib/Time/ParseDate.pm blib\lib\Time\ParseDate.pm
cp lib/Time/DaysInMonth.pm blib\lib\Time\DaysInMonth.pm
cp lib/Time/Timezone.pm blib\lib\Time\Timezone.pm
  MUIR/modules/Time-ParseDate-2013.0920.tar.gz
  C:\Dwimperl\c\bin\dmake.exe -- OK
CPAN: YAML::XS loaded ok (v0.39)
Running make test
C:\Perl64\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib',    'blib\arch')" t/*
t/datetime.t .. ok
t/metdate.t ... skipped: It seems localtime() does not honor $ENV{TZ} when set in the  test script.
t/order1.t .... 1/?
#   Failed test 'Europe/Moscow, DST permanent 2009'
#   at t/order1.t line 34.
#          got: '1257030000'
#     expected: '1257022800'

#   Failed test 'Europe/Moscow, DST permanent 2013'
#   at t/order1.t line 35.
#          got: '1369868400'
#     expected: '1369857600'
# Looks like you failed 2 tests of 5.
t/order1.t .... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/5 subtests
t/order2.t .... 1/?
#   Failed test 'Europe/Moscow, DST permanent 2013'
#   at t/order2.t line 34.
#          got: '1369868400'
#     expected: '1369857600'

#   Failed test 'Europe/Moscow, DST permanent 2009'
#   at t/order2.t line 35.
#          got: '1257030000'
#     expected: '1257022800'
# Looks like you failed 2 tests of 5.
t/order2.t .... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/5 subtests

Test Summary Report
-------------------
t/order1.t  (Wstat: 512 Tests: 5 Failed: 2)
  Failed tests:  3-4
  Non-zero exit status: 2
t/order2.t  (Wstat: 512 Tests: 5 Failed: 2)
  Failed tests:  3-4
  Non-zero exit status: 2
Files=4, Tests=331,  1 wallclock secs ( 0.09 usr +  0.06 sys =  0.16 CPU)
Result: FAIL
Failed 2/4 test programs. 4/331 subtests failed.
dmake.exe:  Error code 130, while making 'test_dynamic'
  MUIR/modules/Time-ParseDate-2013.0920.tar.gz
  C:\Dwimperl\c\bin\dmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MUIR/modules/Time-ParseDate-2013.0920.tar.gz
Running make install
  make test had returned bad status, won't install without force

最佳答案

Time-ParseDate的测试套件根本无法在Windows系统上通过。参见http://matrix.cpantesters.org/?dist=Time-ParseDatehttp://matrix.cpantesters.org/?dist=Time-ParseDate;maxver=1。我自己对Strawberry Perl和ActivePerl进行了尝试,并且两个Perls的测试套件均失败了(测试需要弄乱TZ环境变量,但这在Windows系统上的工作方式不同于在Unix/Linux系统上的工作方式,另请参见错误报告) https://rt.cpan.org/Ticket/Display.html?id=90367)。

您可以通过强制安装或跳过测试来尝试安装未经测试的模块。在CPAN Shell中:

force install Date::JulianDay

或者
notest install Date::JulianDay

关于windows - 时间:: ParseDate安装失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19956693/

10-13 07:47
查看更多