gpt4 book ai didi

perl - cpan 安装模块 DBD::mysql 失败,雪豹

转载 作者:行者123 更新时间:2023-12-02 11:47:49 27 4
gpt4 key购买 nike

我正在安装 Koha 的依赖项。这需要使用perl和cpan,这是我第一次。我通过 hivelogic 指令安装了 mysql。我在 32 位 mac mini 上运行 10.6.2。

这是终端输出:

John-Breedloves-Mac-mini:~ john_breedlove$ sudo -H cpan -i DBD::mysql
CPAN: Storable loaded ok (v2.19)
Going to read /var/root/.cpan/Metadata
Database was generated on Tue, 19 Jan 2010 14:52:55 GMT
Running install for module 'DBD::mysql'
CPAN: YAML loaded ok (v0.71)
Running make for C/CA/CAPTTOFU/DBD-mysql-4.013.tar.gz
CPAN: Digest::SHA loaded ok (v5.48)
CPAN: Time::HiRes loaded ok (v1.9715)
LWP not available

Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get
http://www.perl.org/CPAN/authors/id/C/CA/CAPTTOFU/CHECKSUMS
Checksum for /var/root/.cpan/sources/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.013.tar.gz ok
x DBD-mysql-4.013/
x DBD-mysql-4.013/lib/
x DBD-mysql-4.013/lib/DBD/
x DBD-mysql-4.013/lib/DBD/mysql.pm
x DBD-mysql-4.013/lib/DBD/mysql/
x DBD-mysql-4.013/lib/DBD/mysql/GetInfo.pm
x DBD-mysql-4.013/lib/DBD/mysql/INSTALL.pod
x DBD-mysql-4.013/lib/Bundle/
x DBD-mysql-4.013/lib/Bundle/DBD/
x DBD-mysql-4.013/lib/Bundle/DBD/mysql.pm
x DBD-mysql-4.013/mysql.xs
x DBD-mysql-4.013/dbdimp.c
x DBD-mysql-4.013/myld
x DBD-mysql-4.013/INSTALL.html
x DBD-mysql-4.013/Makefile.PL.embedded
x DBD-mysql-4.013/TODO
x DBD-mysql-4.013/README
x DBD-mysql-4.013/MANIFEST.SKIP
x DBD-mysql-4.013/ChangeLog
x DBD-mysql-4.013/Makefile.PL
x DBD-mysql-4.013/META.yml
x DBD-mysql-4.013/dbdimp.h
x DBD-mysql-4.013/eg/
x DBD-mysql-4.013/eg/prepare_memory_usage.pl
x DBD-mysql-4.013/eg/proc_example2b.pl
x DBD-mysql-4.013/eg/proc_example2.pl
x DBD-mysql-4.013/eg/decimal_test.pl
x DBD-mysql-4.013/eg/bug30033pg.pl
x DBD-mysql-4.013/eg/proc_example2a.pl
x DBD-mysql-4.013/eg/proc_example4.pl
x DBD-mysql-4.013/eg/bug21028.pl
x DBD-mysql-4.013/eg/bug14979.pl
x DBD-mysql-4.013/eg/bug30033.pl
x DBD-mysql-4.013/eg/issue21946.pl
x DBD-mysql-4.013/eg/proc_example3.pl
x DBD-mysql-4.013/eg/proc_example1.pl
x DBD-mysql-4.013/constants.h
x DBD-mysql-4.013/t/
x DBD-mysql-4.013/t/85init_command.t
x DBD-mysql-4.013/t/40listfields.t
x DBD-mysql-4.013/t/40bindparam.t
x DBD-mysql-4.013/t/mysql.mtest
x DBD-mysql-4.013/t/41bindparam.t
x DBD-mysql-4.013/t/76multi_statement.t
x DBD-mysql-4.013/t/40nulls.t
x DBD-mysql-4.013/t/32insert_error.t
x DBD-mysql-4.013/t/40catalog.t
x DBD-mysql-4.013/t/51bind_type_guessing.t
x DBD-mysql-4.013/t/40bindparam2.t
x DBD-mysql-4.013/t/41blobs_prepare.t
x DBD-mysql-4.013/t/20createdrop.t
x DBD-mysql-4.013/t/70takeimp.t
x DBD-mysql-4.013/t/42bindparam.t
x DBD-mysql-4.013/t/00base.t
x DBD-mysql-4.013/t/55utf8.t
x DBD-mysql-4.013/t/65types.t
x DBD-mysql-4.013/t/40server_prepare_error.t
x DBD-mysql-4.013/t/31insertid.t
x DBD-mysql-4.013/t/29warnings.t
x DBD-mysql-4.013/t/40types.t
x DBD-mysql-4.013/t/10connect.t
x DBD-mysql-4.013/t/lib.pl
x DBD-mysql-4.013/t/mysql.dbtest
x DBD-mysql-4.013/t/35limit.t
x DBD-mysql-4.013/t/71impdata.t
x DBD-mysql-4.013/t/40blobs.t
x DBD-mysql-4.013/t/40server_prepare.t
x DBD-mysql-4.013/t/40numrows.t
x DBD-mysql-4.013/t/35prepare.t
x DBD-mysql-4.013/t/40keyinfo.t
x DBD-mysql-4.013/t/75supported_sql.t
x DBD-mysql-4.013/t/60leaks.t
x DBD-mysql-4.013/t/50commit.t
x DBD-mysql-4.013/t/30insertfetch.t
x DBD-mysql-4.013/t/50chopblanks.t
x DBD-mysql-4.013/t/25lockunlock.t
x DBD-mysql-4.013/t/80procs.t
x DBD-mysql-4.013/MANIFEST
CPAN: File::Temp loaded ok (v0.20)

CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.013.tar.gz

Can't locate DBI/DBD.pm in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level /opt/local/lib/perl5/site_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.9 /opt/local/lib/perl5/vendor_perl /opt/local/lib/perl5/5.8.9/darwin-2level /opt/local/lib/perl5/5.8.9 .) at Makefile.PL line 24.
Warning: No success on command[/opt/local/bin/perl Makefile.PL]
CAPTTOFU/DBD-mysql-4.013.tar.gz
/opt/local/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install

最佳答案

线索就在您引用的输出的这一行中:

    Can't locate DBI/DBD.pm in @INC...

当您使用 Perl 进行开发时,您会经常看到这种类型的错误!这意味着您缺少模块依赖项,通常是因为尚未从 CPAN 安装该模块。

因此,您需要安装DBI::DBD首先之前DBD::mysql 。有some complicated reasons为什么 cpan 不自动安装它作为先决条件(通常在安装模块或发行版时,它会自动安装其所有依赖项):

PREREQ_PM tells MakeMaker that DBI (version 1.03 in this case) is required for this module. This will issue a warning that DBI 1.03 is missing if someone attempts to install your DBD without DBI 1.03. See CONFIGURE below for why this does not work reliably in stopping cpan testers failing your module if DBI is not installed.

CONFIGURE is a subroutine called by MakeMaker during WriteMakefile. By putting the require DBI::DBD in this section we can attempt to load DBI::DBD but if it is missing we exit with success. As we exit successfully without creating a Makefile when DBI::DBD is missing cpan testers will not report a failure. This may seem at odds with PREREQ_PM but PREREQ_PM does not cause WriteMakefile to fail (unless you also specify PREREQ_FATAL which is strongly discouraged by MakeMaker) so WriteMakefile would continue to call dbd_dbi_arch_dir and fail.

您可以使用以下命令同时安装两个模块:

    sudo -H cpan DBI::DBD DBD::mysql

关于perl - cpan 安装模块 DBD::mysql 失败,雪豹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2098391/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com