【问题标题】:Build.PL wont run in git repoBuild.PL 不会在 git repo 中运行
【发布时间】:2013-04-24 17:19:53
【问题描述】:

我正在尝试运行 bioperl-live 软件包,并且我已经 git 克隆了以下 repo

git clone https://github.com/bioperl/bioperl-live.git

然后 cd 到 bio-perl live 的安装位置。然后我尝试运行:

perl Build.PL

我回来了:

Checking prerequisites...
  build_requires:
    !  Test::Most is not installed

所以我打开了一个 cpan shell,当我从 cpan 运行时:

cpan>install Test::Most

并重复构建我得到同样的错误。有人介意克隆上面的 git repo(如果您想检查自己,请在 https://github.com/bioperl/bioperl-live 找到),如果您遇到同样的问题,请告诉我。

请注意,其他包中的其他 Build.PL 文件不会发生这种情况 - 它运行良好。 git repo 中一定有一些损坏/丢失的东西。

谢谢

更新 - 当我运行 perl -wle 'use Test::Most'

我明白了:

在@INC 中找不到Test/Most.pm(@INC 包含:/home/arron/src/bioperl-live /etc/perl /usr/local/lib/perl/5.12.4 /usr/local /share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl .) 在 -e 行1. BEGIN failed--编译在 -e line 1.enter code here中止

同样将 cpan 配置为以 root 身份安装,然后安装 Test::Most 没有任何区别。这么大惊小怪!

【问题讨论】:

  • perl Build.PL \n Can't locate Bio/Root/Build.pm in @INC... 我想我需要 bioperl 才能使用它?
  • 啊,我明白了,有一个单独且未记录的 Bio-Root 存储库。 :-/

标签: perl bioperl


【解决方案1】:

我怀疑这是 bioperl 的问题。您正在使用的cpan 命令更有可能不是为您用于运行Build.PL 的perl 安装的。所以 Test::Most 正在安装,但不是为您的 perl 安装的。您可以确认是否使用perl -wle 'use Test::Most' 安装了Test::Most。

检查which cpan 和which perl。它们应该具有相同的根路径。 IE。 /usr/bin/cpan 和 /usr/bin/perl。

一种可能性是您正在运行sudo cpan,但只是运行perl Build.PL。 sudo 可能会改变你的PATH,从而选择不同的cpan 和不同的perl。如果您正在使用sudo cpan,请务必使用sudo which cpan。

您可以通过在 cpan 提示符下键入 ! print "$^X\n" 来检查正在安装的 perl cpan。 ! 告诉 cpan 执行任意 perl 代码。 $^X 是一个保存 perl 路径的变量。这是一个为正确的 perl 安装 cpan 的示例。

$ cpan

cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.

cpan[1]> ! print "$^X\n"
/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/bin/perl
cpan[1]> q

$ which perl
/Users/schwern/perl5/perlbrew/perls/perl-5.16.2-threads/bin/perl

此外,您应该避免以 root 身份运行 cpan,而应使用 configure CPAN to install as root。您可能需要 sudo chown yourusername -R ~/.cpan 才能使其正常工作,因为 root 可能拥有您的 .cpan 目录。

【讨论】:

  • 对不起,perl -wle 'use Test::Most' 和 perl -e 'use Test::Most' 有什么区别?我以前从未使用过此选项。始终只使用-e 选项
  • -w 打开警告。 -l 将$\ 设置为换行符,这使得print 添加了换行符。
  • @Schwern - 请查看我更新的问题以查看运行 perl -wle 'use Test::Most' 的结果
  • @Suic -wle 是我使用命令行程序的习惯,几乎没有理由不使用-wl,所以我总是这样做。 -e 也可以。
  • @brucezepplin 根据您所写的,这绝对不是 bioperl 问题。您正在调用的 cpan 未安装到您正在使用的 perl。它适用于机器上安装的其他一些 perl。贴出各种which 命令的输出,我们可以整理出来。您还可以在cpan> 提示符处通过! print "$^X\n" 确定CPAN shell 正在使用哪个perl。
猜你喜欢
  • 2015-10-10
  • 2012-08-11
  • 1970-01-01
  • 2022-11-11
  • 2019-08-03
  • 2013-10-04
  • 2011-06-07
  • 1970-01-01
  • 2020-06-14
相关资源
最近更新 更多