简体   繁体   中英

(Perl) Cannot do `initialize' in Term::ReadLine::Gnu in Mac OSX 10.6

I recently installed MacPorts and I think it might have messed up some of my libraries. Now when I try to run the Perl debugger I get this:

perl -d -e 0

Cannot do `initialize' in Term::ReadLine::Gnu at /opt/local/lib/perl5/5.8.9/perl5db.pl line 6006
 at /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Term/ReadLine/Gnu.pm line 716
    Term::ReadLine::Gnu::AU::AUTOLOAD('Term::ReadLine=HASH(0x8f8b94)') called at /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Term/ReadLine/Gnu.pm line 240
    Term::ReadLine::Gnu::new('Term::ReadLine', 'perldb', 'GLOB(0x85c690)', 'GLOB(0x855750)') called at /opt/local/lib/perl5/5.8.9/perl5db.pl line 6006
    DB::setterm called at /opt/local/lib/perl5/5.8.9/perl5db.pl line 2235
    DB::DB called at -e line 1
Cannot do `initialize' in Term::ReadLine::Gnu at /opt/local/lib/perl5/5.8.9/perl5db.pl line 6006
END failed--call queue aborted at -e line 44.
 at -e line 44
Config::DESTROY(/opt/local/lib/perl5/5.8.9/darwin-2level/Config.pm:63):
63: sub DESTROY { }
IO::Handle::DESTROY(/opt/local/lib/perl5/5.8.9/darwin-2level/IO/Handle.pm:330):
330:    sub DESTROY {} 

I'm using readline 6.1. Anyone have any ideas?

Thanks

I just encountered this issue on my Mac. Interestingly, my attempts to enter the cpan interactive console also generated this same error.

Based on some web searches, I then ran this command: cpan install Term::ReadLine::Gnu

This resolved the issue for me. I was then able to enter the cpan interactive console as well as run the perl debugger using perl -d -e 0

I don't know how this work on OSX, but I just had the same problem on linux. I solved it by installing libtermcap2(deb) or compat-libtermcap(rpm).

I found the solution here

I've never had much luck with the Macports version of Perl. I always install my own.

You aren't going to have the same modules installed, because (for example), 5.8, 5.9, and 5.10 are not binary compatibile. The module in question likely requires a C compiler to build.

Is there some reason you don't want to build and install a modern version of Perl?

I executed

brew uninstall --ignore-dependencies term-readline-gnu-perl
brew install term-readline-gnu-perl

and it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM