cpan 安装模块 DBD::mysql 失败,雪豹
我正在为 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
线索就在您引用的输出的这一行中:
当您在 Perl 中开发时,您会经常看到这种类型的错误!这意味着您缺少模块依赖项,通常是因为尚未从 CPAN 安装该模块。
因此,您需要在 DBI::DBD ://search.cpan.org/perldoc/DBD::mysql" rel="noreferrer">DBD::mysql。有一些复杂的原因为什么< code>cpan 作为先决条件(通常在安装模块或发行版时,它会自动安装其所有依赖项):
您可以使用以下命令同时安装两个模块:
The clue was in this line of your quoted output:
You'll be seeing this type of error a lot as you develop in Perl! It means that you are missing a module dependency, generally because the module hasn't been installed from CPAN.
Therefore, you need to install DBI::DBD first before DBD::mysql. There are some complicated reasons why this isn't installed automatically by
cpan
as a prerequisite (usually when installing a module or distribution, it will automatically install all its dependencies):You can install both modules at once with:
我花了一个晚上的大部分时间在谷歌上搜索并尝试各种方向来让 DBD::mysql 与我现有的 osx perl 安装一起工作。我没有取得任何进展,最后尝试安装活动 perl。它带有一个 perl 包管理器 (ppm)。从那里,您可以安装纯 perl mysql 驱动程序 (DBD::mysqlPP),这绕过了所有编译难题。 - 请务必更改您的代码以使用 DBD::mysqlPP 而不是 DBD::mysql - 就我而言,我更改了
这:
我的 $dsn = 'DBI:mysql:schemaName:localhost';
对此:
我的 $dsn = 'DBI:mysqlPP:schemaName:localhost';
I spent a most of an evening googleing and trying the various directions to get DBD::mysql to work with my existing osx perl installation. I was making no progress and finally tried installing active perl. It comes with a perl package manager (ppm). From there, you can install a pure perl mysql driver (DBD::mysqlPP) and this bypasses all the compilation headaches. - Just be sure to change your code to use DBD::mysqlPP rather than DBD::mysql - in my case, I changed
this:
my $dsn = 'DBI:mysql:schemaName:localhost';
to this:
my $dsn = 'DBI:mysqlPP:schemaName:localhost';
首先尝试安装 DBI.pm。
Try installing DBI.pm first.