无法安装Perl模块,因为Ubuntu 14.04上缺少cc1编译器

无法安装Perl模块,因为Ubuntu 14.04上缺少cc1编译器,perl,ubuntu,gcc,Perl,Ubuntu,Gcc,我正试图在Ubuntu 14.04上使用cpanm安装Moose,但我收到一个错误提示: Running Makefile.PL Configuring Moose-2.1210 ... cc: error trying to exec 'cc1': execvp: No such file or directory This distribution requires a working compiler at Makefile.PL line 52. N/A ! Configure fail

我正试图在Ubuntu 14.04上使用
cpanm
安装
Moose
,但我收到一个错误提示:

Running Makefile.PL
Configuring Moose-2.1210 ... cc: error trying to exec 'cc1': execvp: No such file or directory
This distribution requires a working compiler at Makefile.PL line 52.
N/A
! Configure failed for Moose-2.1210. See /home/hakon/.cpanm/work/1407056127.30229/build.log for details.
我已经安装了
gcc
4.8.2版编译器:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.8/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) 
以下是更多输出(整个输出可用):

$cpanm-v驼鹿
为i686-linux-gnu-thread-multi-64int构建的Perl5.018002上的cpanm(App::cpanminus)1.7004
工作目录是/home/hakon/.cpanm/Work/1407056507.30283
你有make/usr/bin/make
你有LWP 6.05
您有/bin/tar:tar(GNU tar)1.27.1
版权所有(C)2013免费软件基金会。
许可证GPLv3+:GNU GPL版本3或更高版本。
这是自由软件:您可以自由更改和重新发布它。
在法律允许的范围内,不存在任何担保。
由约翰·吉尔摩和杰伊·芬拉森撰写。
您有/usr/bin/unzip
正在检查是否有ExtUtils::MakeMaker 6.31。。。是(6.66)
正在检查是否有ExtUtils::Install 1.46。。。是(1.59)
在cpanmetadb上搜索驼鹿。。。
解包驼鹿-2.1210.tar.gz
-->在驼鹿身上工作
吸引http://www.cpan.org/authors/id/E/ET/ETHER/Moose-2.1210.tar.gz ... 好啊
驼鹿-2.1210/
Moose-2.1210/作者/
驼鹿-2.1210/基准/
驼鹿-2.1210/箱/
驼鹿-2.1210/变化
Moose-2.1210/Changes.Class-MOP
驼鹿-2.1210/dist.ini
驼鹿-2.1210/doc/
驼鹿-2.1210/inc/
驼鹿-2.1210/lib/
Moose-2.1210/许可证
Moose-2.1210/Makefile.PL
驼鹿-2.1210/舱单
Moose-2.1210/META.json
Moose-2.1210/META.yml
驼鹿-2.1210/澳门币
驼鹿-2.1210/mop.h
...
...
Moose-2.1210/benchmarks/cmop/run_yml.pl
Moose-2.1210/benchmarks/cmop/lib/Bench/
Moose-2.1210/benchmarks/cmop/lib/MOP/
Moose-2.1210/benchmarks/cmop/lib/Plain/
Moose-2.1210/benchmarks/cmop/lib/Plain/Point.pm
Moose-2.1210/benchmarks/cmop/lib/Plain/Point3D.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Immutable/
Moose-2.1210/benchmarks/cmop/lib/MOP/Installed/
Moose-2.1210/benchmarks/cmop/lib/MOP/Point.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Point3D.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Installed/Point.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Installed/Point3D.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Immutable/Point.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Immutable/Point3D.pm
Moose-2.1210/benchmarks/cmop/lib/Bench/Accessor.pm
Moose-2.1210/benchmarks/cmop/lib/Bench/Construct.pm
Moose-2.1210/benchmarks/cmop/lib/Bench/Run.pm
Moose-2.1210/author/docGenerator.pl
Moose-2.1210/author/extract-inline-tests
Moose-2.1210/author/find-dupe-test-numbers
进入驼鹿-2.1210
正在检查META.json中的配置依赖项
正在检查是否有Dist::CheckConflicts 0.02。。。是(0.11)
正在检查是否有ExtUtils::MakeMaker 6.30。。。是(6.66)
正在检查是否有文件::规范0。。。是(3.40)
正在检查是否有ExtUtils::CBuilder 0.27。。。是(0.280210)
运行Makefile.PL
正在配置Moose-2.1210。。。cc:尝试执行“cc1”时出错:execvp:没有这样的文件或目录
此发行版需要Makefile.PL第52行的编译器工作。
! 为Moose-2.1210配置失败。有关详细信息,请参阅/home/hakon/.cpanm/work/1407056507.30283/build.log。
不适用

Install“a working compiler”?我已经安装了gcc版本4.8.2。我还需要什么?有关更多信息,请参阅更新的问题。模块安装程序尝试运行cc,而不是gcc。当从命令行调用cc时,它对您有效吗?谢谢@n.m。我发现了这个问题。我的主文件夹中的
cc
命令与
/usr/bin/cc
中的编译器之间存在冲突。在我的
~/.bashrc
中,我在
$PATH
上的
/usr/bin
之前添加了
$HOME/bin
,因此它没有找到正确的命令。。
$ cpanm -v Moose 
cpanm (App::cpanminus) 1.7004 on perl 5.018002 built for i686-linux-gnu-thread-multi-64int
Work directory is /home/hakon/.cpanm/work/1407056507.30283
You have make /usr/bin/make
You have LWP 6.05
You have /bin/tar: tar (GNU tar) 1.27.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Checking if you have ExtUtils::MakeMaker 6.31 ... Yes (6.66)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.59)
Searching Moose on cpanmetadb ...
Unpacking Moose-2.1210.tar.gz
--> Working on Moose
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Moose-2.1210.tar.gz ... OK
Moose-2.1210/
Moose-2.1210/author/
Moose-2.1210/benchmarks/
Moose-2.1210/bin/
Moose-2.1210/Changes
Moose-2.1210/Changes.Class-MOP
Moose-2.1210/dist.ini
Moose-2.1210/doc/
Moose-2.1210/inc/
Moose-2.1210/lib/
Moose-2.1210/LICENSE
Moose-2.1210/Makefile.PL
Moose-2.1210/MANIFEST
Moose-2.1210/META.json
Moose-2.1210/META.yml
Moose-2.1210/mop.c
Moose-2.1210/mop.h
...
<cut>
...
Moose-2.1210/benchmarks/cmop/run_yml.pl
Moose-2.1210/benchmarks/cmop/lib/Bench/
Moose-2.1210/benchmarks/cmop/lib/MOP/
Moose-2.1210/benchmarks/cmop/lib/Plain/
Moose-2.1210/benchmarks/cmop/lib/Plain/Point.pm
Moose-2.1210/benchmarks/cmop/lib/Plain/Point3D.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Immutable/
Moose-2.1210/benchmarks/cmop/lib/MOP/Installed/
Moose-2.1210/benchmarks/cmop/lib/MOP/Point.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Point3D.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Installed/Point.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Installed/Point3D.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Immutable/Point.pm
Moose-2.1210/benchmarks/cmop/lib/MOP/Immutable/Point3D.pm
Moose-2.1210/benchmarks/cmop/lib/Bench/Accessor.pm
Moose-2.1210/benchmarks/cmop/lib/Bench/Construct.pm
Moose-2.1210/benchmarks/cmop/lib/Bench/Run.pm
Moose-2.1210/author/docGenerator.pl
Moose-2.1210/author/extract-inline-tests
Moose-2.1210/author/find-dupe-test-numbers
Entering Moose-2.1210
Checking configure dependencies from META.json
Checking if you have Dist::CheckConflicts 0.02 ... Yes (0.11)
Checking if you have ExtUtils::MakeMaker 6.30 ... Yes (6.66)
Checking if you have File::Spec 0 ... Yes (3.40)
Checking if you have ExtUtils::CBuilder 0.27 ... Yes (0.280210)
Running Makefile.PL
Configuring Moose-2.1210 ... cc: error trying to exec 'cc1': execvp: No such file or directory
This distribution requires a working compiler at Makefile.PL line 52.
! Configure failed for Moose-2.1210. See /home/hakon/.cpanm/work/1407056507.30283/build.log for details.
N/A