Chinaunix首页 | 论坛 | 博客
  • 博客访问: 370593
  • 博文数量: 83
  • 博客积分: 2213
  • 博客等级: 大尉
  • 技术积分: 835
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-16 20:26
文章分类

全部博文(83)

文章存档

2015年(1)

2012年(1)

2011年(14)

2007年(20)

2006年(47)

我的朋友

分类: LINUX

2011-08-08 17:33:55


在使用CPAN安装PERL模块的时候,报如下错误的解决办法:


Going to read '/root/.cpan/sources/modules/03modlist.data.gz'
Catching error: "Can't locate object method \"data\" via package \"CPAN::Modulelist\" (perhaps you forgot to load \"CPAN::Modulelist\"?) at (eval 58) line 1.\cJ at /usr/local/lib/perl5/5.14.1/CPAN/Index.pm line 524\cJ\cICPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/local/lib/perl5/5.14.1/CPAN/Index.pm line 85\cJ\cICPAN::Index::reload('CPAN::Index') called at /usr/local/lib/perl5/5.14.1/CPAN.pm line 975\cJ\cICPAN::exists('CPAN=HASH(0x152bb7c8)', 'CPAN::Module', 'EV') called at /usr/local/lib/perl5/5.14.1/CPAN/Shell.pm line 1255\cJ\cICPAN::Shell::expandany('CPAN::Shell', 'EV') called at /usr/local/lib/perl5/5.14.1/CPAN/Shell.pm line 1680\cJ\cICPAN::Shell::rematein('CPAN::Shell', 'install', 'EV') called at /usr/local/lib/perl5/5.14.1/CPAN/Shell.pm line 1976\cJ\cICPAN::Shell::__ANON__('CPAN::Shell', 'EV') called at /usr/local/lib/perl5/5.14.1/CPAN.pm line 375\cJ\cIeval {...} called at /usr/local/lib/perl5/5.14.1/CPAN.pm line 372\cJ\cICPAN::shell() called at -e line 1\cJ" at /usr/local/lib/perl5/5.14.1/CPAN.pm line 391
        CPAN::shell() called at -e line 1
Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Mon, 08 Aug 2011 06:27:12 GMT
  HTTP::Date not available
...............
  New CPAN.pm version (v1.9800) available.
  [Currently running version is v1.9600]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


.............................................................DONE
Going to read '/root/.cpan/sources/modules/03modlist.data.gz'
Terminal does not support GetHistory.
Lockfile removed.
Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 60) line 1.
 at /usr/local/lib/perl5/5.14.1/CPAN/Index.pm line 524
        CPAN::Index::rd_modlist('
CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/local/lib/perl5/5.14.1/CPAN/Index.pm line 85
        CPAN::Index::reload('
CPAN::Index') called at /usr/local/lib/perl5/5.14.1/CPAN.pm line 692
        CPAN::all_objects('
CPAN=HASH(0x152bb7c8)', 'CPAN::Distribution') called at /usr/local/lib/perl5/5.14.1/CPAN/Shell.pm line 1044
        CPAN::Shell::failed('
CPAN::Shell


解决办法如下:



[root@localhost CPAN]# perl -MCPAN -e shell




cpan[1]> reload index    #执行此步就可以了。


因为我是安装REDIS的sharding 布局,需要安装PERL的EV和CRC32 模块。其中在安装EV的时候,是正常的。



cpan[2]> install EV


但是在安装 CRC32的时候,有如下提示:


cpan[1]> install CRC32
Going to read '/root/.cpan/Metadata'
  Database was generated on Mon, 08 Aug 2011 07:39:43 GMT
Warning: Cannot install CRC32, don't know what it is.
Try the command

    i /CRC32/

to find objects with matching identifiers.

按提示我们执行:





cpan[2]> i /CRC32/
Distribution FAYS/Digest-Crc32-0.01.tar.gz
Distribution SOENKE/String-CRC32-1.4.tar.gz
Module < Digest::Crc32 (FAYS/Digest-Crc32-0.01.tar.gz)
Module < String::CRC32 (SOENKE/String-CRC32-1.4.tar.gz)
4 items found


接下分别安装: Digest::Crc32和String::CRC32我就可以了。



cpan[3]> install Digest::Crc32




cpan[4]> install String::CRC32


阅读(5802) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~