我正在为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
答案 0 :(得分:6)
线索在你引用的输出的这一行:
Can't locate DBI/DBD.pm in @INC...
在Perl中开发时,你会看到很多类型的错误!这意味着您缺少模块依赖性,通常是因为尚未从CPAN安装模块。
因此,您需要先在DBI::DBD之前安装DBD::mysql。有some complicated reasons为什么cpan
没有自动安装这个作为先决条件(通常在安装模块或发行版时,它会自动安装所有依赖项):
PREREQ_PM告诉MakeMaker该模块需要DBI(本例中为1.03版本)。如果有人在没有DBI 1.03的情况下尝试安装DBD,这将发出DBI 1.03丢失的警告。请参阅下面的配置,了解如果在未安装DBI的情况下停止cpan测试人员模块失败,这将无法正常工作。
CONFIGURE是在MakeMakefile期间由MakeMaker调用的子程序。通过将require DBI :: DBD放在本节中,我们可以尝试加载DBI :: DBD,但如果它丢失了,我们就会成功退出。当DBI :: DBD缺失时,我们成功退出而不创建Makefile,cpan测试人员不会报告失败。这似乎与PREREQ_PM不一致,但PREREQ_PM不会导致WriteMakefile失败(除非您还指定MakeMaker强烈建议不要使用PREREQ_FATAL),因此WriteMakefile将继续调用dbd_dbi_arch_dir并失败。
您可以使用以下方法一次安装两个模块:
sudo -H cpan DBI::DBD DBD::mysql
答案 1 :(得分:1)
我花了大部分时间进行googleing并尝试各种指示让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';
答案 2 :(得分:0)
首先尝试安装DBI.pm。