【发布时间】:2011-04-26 16:20:42
【问题描述】:
我刚刚安装了 ubuntu 10.10 的新副本。我在brian d foy's recommended outline 之后安装了perl 5.12.2,然后通过调用curl -L http://cpanmin.us | perl5.12.2 - --sudo App::cpanminus 安装了cpanminus。
现在,cpan5.12.2 工作正常,但是每当我尝试使用 cpanm5.12.2 安装模块时,它都找不到它。例如:
$ sudo cpanm5.12.2 -v File::Copy::Recursive
You have make /usr/bin/make
You have LWP 5.837
You have /bin/tar: tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching File::Copy::Recursive on cpanmetadb ...
! Finding File::Copy::Recursive on cpanmetadb failed.
Searching File::Copy::Recursive on search.cpan.org ...
! Finding File::Copy::Recursive on search.cpan.org failed.
! Couldn't find module or a distribution File::Copy::Recursive
【问题讨论】:
-
普通cpan能安装吗?
-
你有代理吗?
perl -wle 'use LWP::Simple; getprint "http://cpanmetadb.appspot.com/v1.0/package/File::Copy::Recursive"'是否返回 YAML 文件? -
@brian d foy:是的,如前所述 - cpan5.12.2 工作正常。
-
@Schwern 我确实使用代理。你的命令返回
--- distfile: D/DM/DMUEY/File-Copy-Recursive-0.38.tar.gz version: 0.38。 -
这就是它应该返回的,但是
perl和perl5.12.2一样吗?使用perl5.12.2再试一次。我怀疑代理正在干扰。您设置了 HTTP_PROXY 或 http_proxy 环境变量? LWP 应该检测到并使用它。