无法在 @INC ... 中找到 MIME/Types.pm 在 /usr/local/share/perl/5.10.1/Dancer/MIME.pm 第 7 行

发布于 2024-10-21 07:01:08 字数 1919 浏览 5 评论 0原文

我对编程很陌生,所以如果我错过了一些明显的事情,我深表歉意。

我正在按照 https://github.com/keeth/Net- 的指示进行操作OAuth/blob/master/README 并收到以下错误:

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.

听起来 perl 模块 Dancer/MIME.pm 中存在错误?如果是这样,我不知道如何调试它。

附录:更多错误消息。

$ ./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/Route/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

顺便说一句,我使用 Ubuntu 10.04。

问题:这是什么意思以及我应该做什么?

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/Route/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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

泪意 2024-10-28 07:01:08

您的系统上未安装 MIME::Types 模块,或者它不在您的路径中。如果是前者,则安装它(可以使用 cpan 来完成此操作)。如果它存在但不在正常位置(读取:“@INC contains:”错误中列出的目录之一),您可以通过

use lib '/path/to/library';

use MIME::Types;声明。

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.

望喜 2024-10-28 07:01:08

听起来您需要安装 MIME::Types 模块。

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

玩心态 2024-10-28 07:01:08

thegeekStuff 链接< /a> 完美解释了安装perl模块的过程。请浏览链接。

要安装单个 perl 模块:

  1. 下载 perl 模块,您可以在 CPAN 上找到它。

  2. 提取它,然后make

<前><代码>$ gzip -d XML-Parser-2.36.tar.gz
$ tar xvf XML-Parser-2.36.tar

现在制作

$ perl Makefile.PL  
检查您的套件是否完整...  
看起来不错  
为 XML::Parser::Expat 编写 Makefile  
为 XML::Parser 编写 Makefile  
$ 制作  
$ 进行测试  
$ 进行安装

通过这种方法,您将安装单个模块,但如果它有任何依赖模块,则需要手动安装它。或者,安装 perl 模块的最佳方法是 cpan

首先安装一次 cpan

 $ yum install perl-CPAN

,配置后,使用 cpan 安装任何模块。它还将负责安装所有依赖模块。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文