How can I get App::cpanminus to work?

I have just installed a fresh copy of ubuntu 10.10. I installed perl 5.12.2 following brian d foy's recommended outline and then installed cpanminus by invoking curl -L http://cpanmin.us | perl5.12.2 - --sudo App::cpanminus curl -L http://cpanmin.us | perl5.12.2 - --sudo App::cpanminus .

Now, cpan5.12.2 works fine, but whenever I try to install a module using cpanm5.12.2 it fails finding it. eg:

$ 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

You might try using perlbrew [1] to install a custom perl intrepreter. Then you can activate your 5.12.2 version, install cpanm (no sudo required) and install your modules as a normal user eg. "$ cpanm My::Module"

By using this method, you get custom cpanm binaries tied to each specific perlbrew version. You have to install cpan modules for every perlbrew version, but you don't end up with binaries like "cpanm5.12.2" but rather "cpanm". Perlbrew takes care of setting up a perl-version-specific path, which is rather handy IMHO.

[1] https://metacpan.org/module/App::perlbrew


I had the same problem. LWP uses $HTTP_PROXY rather than $http_proxy on my machine.

If you specify something for $http_proxy without the protocol (in my case, I was missing http: ), it will complain but seems misleading as it doesn't actually find the missing packages.

链接地址: http://www.djcxy.com/p/3178.html

上一篇: 表达式.Compile()与ModelMetadata.FromLambdaExpression

下一篇: 我怎样才能让App :: cpanminus工作?