2014-05-06 84 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

問題已解決。這是該死的反病毒軟件在我的機器上運行!