2

我一直在尝试在我全新的 Opensuse 安装上安装几个 perl 模块,但无济于事。我曾尝试通过 CPAN、PPM 和手动安装它们,但始终出现相同的错误:

 Unparsable version '' for prerequisite Test at Makefile.PL line 4.

尽管如此,Makefile.PL似乎可以毫无问题地执行,但随后的 make 执行会出现问题。这是导致我认为问题的消息:

 make: *** [LevenshteinXS.o] Error 127
 JGOLDBERG/Text-LevenshteinXS-0.03.tar.gz
 /usr/bin/make -- NOT OK

我试图做一个whereis make,结果似乎还可以:

 make: /usr/bin/make /usr/bin/X11/make /usr/share/man/man1/make.1.gz /usr/share/man/man1p/make.1p.gz

这是 cpan 在告诉我安装失败之前进行的操作的完整记录:

 CPAN: Storable loaded ok (v2.34)
 Reading '/home/tito/.cpan/Metadata'
 Database was generated on Wed, 24 Oct 2012 19:07:03 GMT
 Running install for module 'Text::LevenshteinXS'
 Running make for J/JG/JGOLDBERG/Text-LevenshteinXS-0.03.tar.gz
 CPAN: Digest::SHA loaded ok (v5.71)
 CPAN: Compress::Zlib loaded ok (v2.048)
 Checksum for /home/tito/.cpan/sources/authors/id/J/JG/JGOLDBERG/Text-LevenshteinXS-0.03.tar.gz ok
 CPAN: File::Temp loaded ok (v0.22)
 CPAN: Parse::CPAN::Meta loaded ok (v1.4404)
 CPAN: CPAN::Meta loaded ok (v2.120630)

 CPAN.pm: Building J/JG/JGOLDBERG/Text-LevenshteinXS-0.03.tar.gz

 Unparsable version '' for prerequisite Test at Makefile.PL line 4.
 Checking if your kit is complete...
 Looks good
 Writing Makefile for Text::LevenshteinXS
 Writing MYMETA.yml and MYMETA.json
 CPAN: Module::CoreList loaded ok (v2.66)
 cp LevenshteinXS.pm blib/lib/Text/LevenshteinXS.pm
 AutoSplitting blib/lib/Text/LevenshteinXS.pm (blib/lib/auto/Text/LevenshteinXS)
 /usr/bin/perl /usr/lib/perl5/5.16.0/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.16.0/ExtUtils/typemap  LevenshteinXS.xs > LevenshteinXS.xsc && mv LevenshteinXS.xsc LevenshteinXS.c
 Please specify prototyping behavior for LevenshteinXS.xs (see perlxs manual)
 cc -c   -D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe   -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -fPIC "-I/usr/lib/perl5/5.16.0/x86_64-linux-thread-multi/CORE"   LevenshteinXS.c
 /bin/sh: cc: command not found
 make: *** [LevenshteinXS.o] Error 127
 JGOLDBERG/Text-LevenshteinXS-0.03.tar.gz
 /usr/bin/make -- NOT OK
 CPAN: YAML loaded ok (v0.84)
 Running make test
  Can't test without successful make
 Running make install
  Make had returned bad status, install seems impossible
4

1 回答 1

7

关于版本的警告就是这样,一个警告。真正的问题是这样的:

/bin/sh: cc: command not found

换句话说:这个模块需要一个 C 编译器,而你没有。无论如何,没有一个 Perl 可以找到。从 OpenSuSE 安装 gcc 包应该可以解决这个问题。

“不可解析的版本”来自 Makefile.PL 中的这一行。

'PREREQ_PM'         => { Test },

PREREQ_PM 表示必备模块及其最低版本。 作者忘记了最低版本。没什么大不了的,Test 永远伴随着 Perl。

于 2012-10-25T18:20:23.853 回答