gpt4 book ai didi

xml - 安装 XML::DOM::XPath 时出错

转载 作者:数据小太阳 更新时间:2023-10-29 02:38:45 25 4
gpt4 key购买 nike

我编写了一个使用 Bio::Seq 和 Bio::SeqIO 包的小 Perl 脚本。当我尝试在基于 linux 的服务器上运行脚本时。我遇到了很多错误,这些错误基本上告诉我尚未安装 BioPerl。

我在本地安装了 ActiveState Perl 5.26 并且已经满足了安装 Bio::Perl 的大部分先决条件。只有 XML::DOM::XPath 仍然是一个问题。尝试安装包后,我收到以下错误:

Test Summary Report
-------------------
t/test_non_ascii.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 10 tests but ran 0.
Files=35, Tests=183, 4 wallclock secs ( 0.12 usr 0.04 sys + 3.46 cusr 0.52 csys = 4.14 CPU)
Result: FAIL
Failed 1/35 test programs. 0/183 subtests failed.
make: *** [test_dynamic] Error 255
MIROD/XML-DOM-XPath-0.14.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports MIROD/XML-DOM-XPath-0.14.tar.gz
Failed during this command:
MIROD/XML-DOM-XPath-0.14.tar.gz : make_test NO


nolock_cpan> reports MIROD/XML-DOM-XPath-0.14.tar.gz
Distribution: M/MI/MIROD/XML-DOM-XPath-0.14.tar.gz
Fetching 'http://www.cpantesters.org/show/XML-DOM-XPath.yaml'...DONE

Catching error: "CPAN::Exception::yaml_process_error=HASH(0x4ca5c28)" at /data/calvin/ActivePerl-5.26/lib/CPAN.pm line 392.
CPAN::shell() called at -e line 1

此错误似乎与 t/test_non_ascii.t 有关,因为尝试运行命令 install "XML::DOM::XPath"的早期输出给出了以下错误:

t/test_non_ascii.t .................... The encoding pragma is no longer supported. Check cperl at t/test_non_ascii.t line 10.
BEGIN failed--compilation aborted at t/test_non_ascii.t line 10.
Looks like your test exited with 2 before it could output anything.
t/test_non_ascii.t .................... Dubious, test returned 2 (wstat 512, 0x200)
Failed 10/10 subtests

有谁知道错误的确切原因是什么以及我该如何解决?

最佳答案

不确定您最终是否解决了这个问题,但问题在于 t/test_non_ascii.t 第 10 行的编码,它使用 encoding.pm Perl 5.25.3 后不再支持:

use encoding 'utf8';

The solution as can be found in the bug reports on CPAN就是把行改成

use utf8;

git diff t/test_nonascii.t/test_non_ascii.t.new 的结果:

--- t/test_non_ascii.t
+++ t/test_non_ascii.t.new
@@ -7,7 +7,7 @@ use strict;
use Test::More tests => 10;
use XML::DOM::XPath;

-use encoding 'utf8';
+use utf8;

my $display_warning=0;

关于xml - 安装 XML::DOM::XPath 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47966512/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com