我有使用DBI e的perl脚本。克
use DBI;
当我执行脚本时,我收到以下错误:
Can't locate DBI.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./install.pl line 15.
a)sudo perl -MCPAN -e 'install DBI'
failed with YAML error
b)sudo apt-get install libyaml-perl
sudo perl -MCPAN -e 'install DBI'
d)c)以这种方式尝试失败
`sudo cpan DBI
在步骤d)和& d)我最后得到以下错误:
Writing Makefile for DBI
Writing MYMETA.yml
TIMB/DBI-1.627.tar.gz
make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
我还需要安装DBD::mysql;
系统信息:
per -v : (v5.14.2) built for x86_64-linux-gnu-thread-multi
此外我安装了gcc
sudo apt-get install gcc
和cc -v
现在是
.....Thread model: posix gcc version 4.6.3 .......
答案 0 :(得分:0)
所以经过一些谷歌搜索后,我发现Ubuntu Forum上有make
失败的链接
帖子#3为我工作
sudo apt-get install libyaml-perl
sudo perl -MCPAN -e 'install DBI'
(除上述问题中的步骤外)
a)sudo apt-get install build-essential autoconf automake libtool gdb
b)sudo cpan DBI
a)sudo apt-get install mysql-server
b)sudo apt-get install libmysqlclient-dev
c)sudo cpan DBD::mysql
我需要以上所有步骤,因为我有新的实例