安装WWW :: Mechanize - 错误获取localhost:无法连接到localhost

时间:2016-08-09 17:23:31

标签: perl perl-module cpan www-mechanize

我正在使用命令

sudo perl -MCPAN -e 'install WWW::Mechanize' 

尝试在macOS上安装WWW :: Mechanize,并不断收到错误

1/13 Error GETing http://localhost:51623/: Can't connect to localhost:51623 (Connection refused) at t/local/referer.t line 39. 

我通过在单词“localhost”的第二个实例的末尾添加-v6来更改文件/ etc / hosts,从而解决了这个问题。 / etc / hosts现在读取

127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost-v6 

现在,在安装过程结束时,我收到了此测试摘要报告:

t/live/wikipedia.t     (Wstat: 512 Tests: 1 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=58, Tests=608, 69 wallclock secs ( 0.25 usr  0.11 sys +  8.25 cusr  1.28 csys =  9.89 CPU)
Result: FAIL
Failed 1/58 test programs. 0/608 subtests failed.
make: *** [test_dynamic] Error 255
  OALDERS/WWW-Mechanize-1.78.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports OALDERS/WWW-Mechanize-1.78.tar.gz
Running make install
  make test had returned bad status, won't install without force

如何安装WWW :: Mechanize?

2 个答案:

答案 0 :(得分:0)

由于正在使用的维基百科页面的证书真实性,我在没有强制安装的情况下获得的(仅)失败测试失败。强制安装WWW :: Mechanize后,模块工作正常。

答案 1 :(得分:-3)

如果您不需要IP v6,请将其从“主机”文件中删除。但对我来说没有任何意义CPAN正试图从'localhost'获取模块因为这个。无论如何,请从主机中删除'ip v6 thing',然后再试一次!