在亚马逊实例上安装Perl DBI

时间:2013-06-12 04:01:55

标签: perl dbi

我有使用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.

试图安装DBI:

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

 failed with YAML error 

b)sudo apt-get install libyaml-perl

c)重新运行a)     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 .......

1 个答案:

答案 0 :(得分:0)

所以经过一些谷歌搜索后,我发现Ubuntu Forum上有make失败的链接

帖子#3为我工作

  1. sudo apt-get install libyaml-perl

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

  3. 安装DBI

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

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

    b)sudo cpan DBI

    安装DBD :: mysql

    a)sudo apt-get install mysql-server

    b)sudo apt-get install libmysqlclient-dev

    c)sudo cpan DBD::mysql

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