我正在尝试弄清楚为什么 Perl 模块无法安装在我的服务器上。
cpanm WWW::Mechanize
它处理东西很长时间,然后最终死亡:
root@admin:~# cpanm WWW::Mechanize
--> Working on WWW::Mechanize
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/WWW-Mechanize-1.90.tar.gz ... OK
Configuring WWW-Mechanize-1.90 ... OK
Building and testing WWW-Mechanize-1.90 ... FAIL
! Installing WWW::Mechanize failed. See /root/.cpanm/work/1543994046.20570/build.log for details. Retry with --force to force install it.
日志文件包含如下内容:
t/00-report-prereqs.t .................... ok
t/add_header.t ........................... ok
t/aliases.t .............................. ok
t/area_link.t ............................ ok
t/autocheck.t ............................ ok
t/bad-request.t .......................... ok
t/clone.t ................................ ok
t/content.t .............................. ok
# Test server http://127.0.0.1:31546 as PID 20661
t/cookies.t .............................. ok
t/credentials-api.t ...................... ok
t/credentials.t .......................... ok
t/die.t .................................. ok
t/dump.t ................................. ok
t/field.t ................................ ok
t/find_frame.t ........................... ok
t/find_image.t ........................... ok
t/find_inputs.t .......................... ok
t/find_link-warnings.t ................... ok
t/find_link.t ............................ ok
t/find_link_id.t ......................... ok
t/form-parsing.t ......................... ok
t/form_with_fields.t ..................... ok
t/form_with_fields_passthrough_params.t .. ok
t/frames.t ............................... ok
# Failed test '... and it was recorded in the history'
# at t/history.t line 131.
# got: '3'
# expected: '2'
# Looks like you failed 1 test of 28.
t/history.t ..............................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/28 subtests
t/image-new.t ............................ ok
t/image-parse.t .......................... ok
t/link-base.t ............................ ok
t/link-relative.t ........................ ok
t/link.t ................................. ok
t/local/back.t ........................... ok
t/local/click.t .......................... ok
t/local/click_button.t ................... ok
# Running tests against http://127.0.0.1:50871/?xml=1
t/local/content.t ........................ ok
t/local/encoding.t ....................... ok
t/local/failure.t ........................ ok
t/local/follow.t ......................... ok
t/local/form.t ........................... ok
t/local/get.t ............................ ok
t/local/nonascii.t ....................... ok
t/local/overload.t ....................... skipped: Mysteriously stopped passing, and I don't know why.
t/local/page_stack.t ..................... ok
t/local/post.t ........................... ok
t/local/referer.t ........................ ok
t/local/reload.t ......................... ok
t/local/submit.t ......................... ok
t/mech-dump/mech-dump.t .................. ok
t/new.t .................................. ok
t/regex-error.t .......................... ok
t/save_content.t ......................... ok
t/select.t ............................... ok
t/taint.t ................................ skipped: Test::Taint required for checking taintedness
t/tick.t ................................. ok
t/untaint.t .............................. ok
t/upload.t ............................... ok
t/uri.t .................................. ok
t/warn.t ................................. ok
t/warnings.t ............................. ok
Test Summary Report
-------------------
t/history.t (Wstat: 256 Tests: 28 Failed: 1)
Failed test: 23
Non-zero exit status: 1
Files=59, Tests=752, 1241 wallclock secs ( 0.29 usr 0.08 sys + 11.13 cusr 1.60 csys = 13.10 CPU)
Result: FAIL
Failed 1/59 test programs. 1/752 subtests failed.
Makefile:946: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
-> FAIL Installing WWW::Mechanize failed. See /root/.cpanm/work/1543994046.20570/build.log for details. Retry with --force to force install it.
我在那里看到了这个,但我不确定它是什么意思:
# Failed test '... and it was recorded in the history'
# at t/history.t line 131.
# got: '3'
# expected: '2'
# Looks like you failed 1 test of 28.
t/history.t ..............................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/28 subtests
有什么建议吗?我需要这个模块来安装另一个模块 :/
答案1
Perl CPAN 包作为 Linux 发行版包安装 [Debian/Ubuntu]
安装 perl 包作为 Linux 发行版包如果可能的话。
在 Ubuntu(和其他 Debian 系列发行版)上使用 WWW::Mechanize 是可能的:
Ubuntu – xenial 中 libwww-mechanize-perl 软件包详细信息
软件包:libwww-mechanize-perl (1.75-1)