开发者

Can't locate MIME/Types.pm in @INC ... at /usr/local/share/perl/5.10.1/Dancer/MIME.pm line 7

I'm very new to programming so I apologise if I've missed something obvious.

I'm following the directions at https://github.com/keeth/Net-OAuth/blob/master/README and got the following error:

Can't locate MIME/Types.pm in @INC
(@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10
/usr/local/lib/site_perl .) at /usr/local/share/perl/5.10.1/Dancer/MIME.pm line 7.

It sounds like there's an error in the perl module Dancer/MIME.pm? If so I don't know how I could ever debug that.

Addendum: more error messages.

$ ./mayor-emanuel.pl Can't locate HTTP/Body.pm in @INC (@INC contains: /etc/perl 
/usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 
/usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at 
/usr/local/share/perl/5.10.1/Dancer/Request.pm line 12. BEGIN failed--compilation aborted at 
/usr/local/share/perl/5.10.1/Dancer/Request.pm line 12. Compilation failed in require at 
/usr/local/share/perl/5.10.1/Dancer/Route.pm line 11. BEGIN failed--compilation aborted at 
/usr/local/share/perl/5.10.1/Dancer/Route.pm line 11. Compilation failed in require at
/usr/local/share/perl/5.10.1/Dancer/Ro开发者_StackOverflow社区ute/Registry.pm line 5. BEGIN failed--compilation 
aborted at /usr/local/share/perl/5.10.1/Dancer/Route/Registry.pm line 5. Compilation failed 
in require at /usr/local/.../Dancer/App.pm line 10. BEGIN failed--compilation aborted at 
/usr/local/share/perl/5.10.1/Dancer/App.pm line 10. Compilation failed in require at 
/usr/local/share/.../Dancer.pm line 13. BEGIN failed--compilation aborted at 
/usr/local/share/perl/5.10.1/Dancer.pm line 13. Compilation failed in require at ./mayor-
emanuel.pl line 5. BEGIN failed--compilation aborted at ./mayor-emanuel.pl line

By the way I use Ubuntu 10.04.

Question: what does this mean and what should I do about it?


Either the MIME::Types module is not installed on your system or it's not in your path. If it's the former, then install it (you can do this with cpan). If it is present but not in a normal location (read: one of the directories listed in the "@INC contains:" error), you can add that directory by adding

use lib '/path/to/library';

ahead of the use MIME::Types; statement.


It sounds like you need to install the MIME::Types module.


The thegeekStuff link perfectly explains the procedures of installing a perl module. Please go through the link.

To install a individual perl module:

  1. Download the perl module, you can find it on CPAN.

  2. Extract it and then make

$ gzip -d XML-Parser-2.36.tar.gz  
$ tar xvf XML-Parser-2.36.tar

now make

$ perl Makefile.PL  
Checking if your kit is complete...  
Looks good  
Writing Makefile for XML::Parser::Expat  
Writing Makefile for XML::Parser  
$ make  
$ make test  
$ make install

By this method you'll install a single module, but if it has any dependent module, you'll need to install it manually. Alternatively the best way to install perl modules is cpan

First get the cpan installed once

 $ yum install perl-CPAN

and after configuring, use cpan to install any module. It'll take care of installing all the dependant modules as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜