安装DBI Perl模块时出错

时间:2017-03-01 02:40:33

标签: perl dbi fedora20

这是我的输出,有什么建议吗?我尝试通过perl -MCPAN -e shell进行安装,然后强制安装DBI。

cpan[10]> force install DBI
Running install for module 'DBI'
Running make for T/TI/TIMB/DBI-1.636.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/DBI-1.636-sGWX9V

  CPAN.pm: Building T/TI/TIMB/DBI-1.636.tar.gz

gcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic   -DVERSION=\"1.636\" -DXS_VERSION=\"1.636\" -fPIC "-I/usr/lib64/perl5/CORE"  -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter Perl.c
/bin/sh: gcc: command not found
make: *** [Perl.o] Error 127
  TIMB/DBI-1.636.tar.gz
  /bin/make -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 TIMB/DBI-1.636.tar.gz                        : make NO

2 个答案:

答案 0 :(得分:5)

错误消息:

    /bin/sh: gcc: command not found

所以你需要安装gcc

答案 1 :(得分:3)

正如您已经看到的那样,安装gcc将解决问题。

但我想知道为什么你不使用预先打包的版本。

$ sudo yum install perl-DBI

另外,您是否意识到Fedora 20现在不受支持?我强烈建议您升级到支持的版本(Fedora 24或25)。