【问题标题】:Time::ParseDate install failTime::ParseDate 安装失败
【发布时间】:2013-11-26 05:25:42
【问题描述】:

我正在尝试安装一个模块来以 HHMMSS 格式操作时间——只是为了找到基本的时间差异等。 Time::ParseDate 看起来是一个完美的候选者,但我在安装它时遇到了一些问题。

我正在使用为 MSWin32-x64-multi-thread 构建的 perl 5,版本 16,subversion 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 版本?

我删除了 Autorun 注册表项,然后重试了安装。我得到了:

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

【问题讨论】:

  • 你能成功安装任何其他模块吗?
  • 当我尝试安装ExUtils::MakeMaker 我得到CPAN: dmake.exe: makefile: line 527: Warning: -- Macro BOOTSTRAP' redefined after use !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Cannot copy 'lib/ExtUtils/MM_OS2.pm' to 'blib\lib\ExtUtils\MM_OS2.pm': No such file or directory !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! at -e line 1. dmake.exe: Error code 130, while making 'pm_to_blib' BINGOS/ExtUtils-MakeMaker-6.82.tar.gz C:\Dwimperl\c\bin\dmake.exe -- NOT OK 等等...
  • 即使我尝试升级 cpan 也会遇到同样的错误。
  • 你搞砸了HKEY->软件->微软->命令处理器->自动运行
  • 你可以试试cpan 然后look Time::ParseDate 看看目录,例如检查这里是否缺少文件?另一个想法:你改变了你的路径。

标签: windows perl module cpan


【解决方案1】:

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 外壳中:

force install Date::JulianDay

notest install Date::JulianDay

【讨论】:

    【解决方案2】:

    似乎您在“HKCU\Software\Microsoft\Command Processor”中的自动运行设置在安装过程中将子进程导航离开当前路径,从而导致在错误的位置创建文件。

    【讨论】:

    • 默认路径是C:\Windows\System32 吗?
    • 或者我应该删除自动运行?
    • 好吧,试一试也无妨(如果您认为以后可能需要,可以在删除之前导出 reg 密钥)。
    • 我这样做了,然后又试了一次。我得到了上面的错误(至少它们是新的错误!)。
    • 当它显示`C:\Dwimperl\c\bin\dmake.exe test -- NOT OK, does that indicate that it is using that perl to create the module? Why would it do so when there are other (more updated) perls in the path`?
    猜你喜欢
    • 2019-03-14
    • 1970-01-01
    • 2013-02-24
    • 1970-01-01
    • 2017-08-14
    • 2021-05-06
    • 2016-03-22
    • 2016-04-15
    • 2016-06-14
    相关资源
    最近更新 更多