2014-05-06 113 views
1

我在Stack Overflow的其他地方看过帖子,提示我安装了用于Strawberry Perl的Mechanize的问题发生在公司的防火墙中,但是我在企业防火墙之后的而不是。我确实使用ISP调制解调器,并在我的桌面上安装了防病毒软件。我应该如何配置cpan来避免这个问题?用草莓(便携式)Perl(用于Windows 7)安装Mechanize的问题

---------------------------------------------- 
Welcome to Strawberry Perl Portable Edition! 
* URL - http://www.strawberryperl.com/ 
* see README.TXT for more info 
---------------------------------------------- 
Perl executable: C:\portableperl\perl\bin\perl.exe 
Perl version : 5.18.2/MSWin32-x64-multi-thread 


C:\portableperl>cpan WWW:Mechanize 
CPAN: CPAN::SQLite loaded ok (v0.203) 
CPAN: LWP::UserAgent loaded ok (v6.05) 
CPAN: Time::HiRes loaded ok (v1.9726) 
Fetching with LWP: 
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz 
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (B 
ad hostname)] 
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t 
xt.gz.tmp2828'. Giving up on it. 
Fetching with LWP: 
http://www.cpan.org/authors/01mailrc.txt.gz 
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname 
)] 
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t 
xt.gz.tmp2828'. Giving up on it. 
Fetching with LWP: 
http://www.cpan.org/authors/01mailrc.txt.gz 
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname 
)] 
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t 
xt.gz.tmp2828'. Giving up on it. 
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t 
xt.gz.tmp2828'. Giving up on it. 
No external ftp command available 

Fetching with LWP: 
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz 
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (B 
ad hostname)] 
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t 
xt.gz.tmp2828'. Giving up on it. 
Fetching with LWP: 
http://www.cpan.org/authors/01mailrc.txt.gz 
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname 
)] 
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t 
xt.gz.tmp2828'. Giving up on it. 
Fetching with LWP: 
http://www.cpan.org/authors/01mailrc.txt.gz 
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname 
)] 
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t 
xt.gz.tmp2828'. Giving up on it. 
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t 
xt.gz.tmp2828'. Giving up on it. 
No external ftp command available 

CPAN: YAML::XS loaded ok (v0.41) 
Please check, if the URLs I found in your configuration file 
(http://cpan.strawberryperl.com/, http://www.cpan.org/, 
http://www.cpan.org/) are valid. The urllist can be edited. E.g. with 'o 
conf urllist push ftp://myurl/' 

Could not fetch authors/01mailrc.txt.gz 


C:\portableperl> 
+0

尝试'平cpan.strawberryperl.com'和'平www.cpan.org'在命令窗口 – Borodin

+0

C:\用户\ JGS>平cpan.strawberryperl.com ping命令cpan.strawberryperl.com [69.163。 179.35]与32字节的数据: 回复69.163.179.35:bytes = 32 time = 64ms TTL = 56 回复69.163.179.35:bytes = 32 time = 64ms TTL = 56 回复69.163.179.35:bytes = 32时间= 64ms TTL = 56 回复自69.163.179.35:bytes = 32 time = 62ms TTL = 56 Ping统计数据为69.163.179.35: 数据包:发送数= 4,接收数= 4,丢失数= 0(0%丢失) , 以毫秒为单位的往返行程时间: 最小= 62ms,最大= 64ms,平均= 63ms –

+0

C:\ Users \ JGS> ping www.cpan.org pinging cpan-global.l.develooper.org [207.171.7.91]带有32个字节的数据: 回复207.171.7.91:bytes = 32 time = 64ms TTL = 55 Reply from 207.171.7.91:bytes = 32 time = 63ms TTL = 55 Reply from 207.171.7.91:bytes = 32 time = 62ms TTL = 55 207.171.7.91:字节= 32时间= 62ms TTL = 55个 平统计207.171.7.91: 包:发送= 4,接收= 4,失落= 0(0%的损失), 近似往返时间在毫秒: 最小= 62ms,最大= 64ms,平均= 62ms C:\ Users \ JGS> –

回答

1

由于错误信息的列表:

LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (Bad hostname)] 
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname)] 

我会建议它无论是与你的互联网连接,您的防火墙,或者你给CPAN权限问题。

我怀疑你可以通过网络浏览器访问上述两个URL之一。

尝试以管理员身份运行cmd提示符,然后重试。

+0

是的,我可以在浏览器中访问这两个网站(尽管第一个网站重定向)。我以管理员身份得到相同的结果,但是在启动具有管理员权限的cmd shell之后,我启动了草莓.bat文件并且可能不会继承这些权限。我对cmd执行上下文一无所知。 –

1

问题已解决。这是该死的反病毒软件在我的机器上运行!