简体   繁体   English

无法在Linux上安装Perl模块

[英]unable to install perl modules on linux

i tried to install perl modules IO::Tty,IO::Pty,Net::SSH2,Net::SSH::Perl....but i have failed to instal a single module.i tried to debug ,but unable to completely fix it.i came to know there is some issue with the compiler.as the below commands have given me the output which indicate something wrong. 我尝试安装perl模块IO :: Tty,IO :: Pty,Net :: SSH2,Net :: SSH :: Perl ....但是我未能安装单个模块。我试图调试,但无法完全修复它。我知道编译器有问题,因为以下命令给了我指示错误的输出。

which gcc
output 
/usr/bin/which: no gcc in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

whereis gcc
output
gcc:

and when i check the error logs after trying to instal the modules , i get the below mentioned error: 当我尝试安装模块后检查错误日志时,出现以下错误:

   [root@GTheGandalf ~]# cat /root/.cpanm/work/1439895011.19383/build.log
   ERROR: cannot run the configured compiler 'gcc'
(see conf/compilerok.log). Suggestions:
1) The compiler 'gcc' is not in your PATH. Add it
to the PATH and try again. OR
2) The compiler isn't installed on your system. Install it. OR
3) You only have a different compiler installed (e.g. 'gcc').
Either fix the compiler config in the perl Config.pm
or install a perl that was built with the right compiler
(you could build perl yourself with the available compiler).

Please help me to fix it as i am unable to execute perl scripts which have a dependency on the above mentioned modules. 请帮助我修复它,因为我无法执行依赖于上述模块的perl脚本。

The error message is self-explanatory. 错误消息是不言自明的。

Install gcc and add it to PATH . 安装gcc并将其添加到PATH

Refer: Installing GCC guide 请参阅: 安装GCC指南

At least some of the modules you mention are implemented in C. You need the C compiler that what used to install your perl , namely gcc . 您提到的至少某些模块是用C实现的。您需要用于安装perl的C编译器,即gcc Use your system's package manager ( apt-get , yum , etc) to install it. 使用系统的软件包管理器( apt-getyum等)进行安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM