2

I have perl script which uses DBI e. g

use DBI;

When I execute the script I get the following error :

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.

Tried to install DBI:

a) sudo perl -MCPAN -e 'install DBI'

 failed with YAML error 

b) sudo apt-get install libyaml-perl

c) re-run a) sudo perl -MCPAN -e 'install DBI'

d) c) failed so tried this way

`sudo cpan DBI  

In both step d) & d) I get following errors at the end:

 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

I do also need to install DBD::mysql;

System info: per -v : (v5.14.2) built for x86_64-linux-gnu-thread-multi

Edit:

Further I installed gcc by sudo apt-get install gcc

and cc -v is now

.....Thread model: posix gcc version 4.6.3 .......

4

1 回答 1

0

所以经过一番谷歌搜索后,我在Ubuntu 论坛make上找到了这个关于失败的链接

post#3 为我工作

  1. sudo apt-get install libyaml-perl

  2. sudo perl -MCPAN -e 'install DBI'

安装 DBI

(除了上述问题中的步骤)

一个)sudo apt-get install build-essential autoconf automake libtool gdb

b)sudo cpan DBI

安装 DBD::mysql

一个)sudo apt-get install mysql-server

b)sudo apt-get install libmysqlclient-dev

C)sudo cpan DBD::mysql

我需要所有上述步骤,因为我有新实例

于 2013-06-12T05:12:32.597 回答