无法使用 cpan 在达尔文 13.0.1 上安装 GD 模块



我在尝试安装 GD 时遇到了困难。我正在运行 Mas OSX 10.9.2 达尔文 13.0.1当我运行这个时: cpan[1]>安装 GD perl -MCPAN -e shell

我收到以下错误:

cpan[1]> install GD
Reading '/Users/me/.cpan/Metadata'
  Database was generated on Sun, 21 Dec 2014 18:53:17 GMT
Running install for module 'GD'
Running make for L/LD/LDS/GD-2.56.tar.gz
Checksum for /Users/me/.cpan/sources/authors/id/L/LD/LDS/GD-2.56.tar.gz ok
Scanning cache /Users/me/.cpan/build for sizes
............................................................................DONE
  CPAN.pm: Building L/LD/LDS/GD-2.56.tar.gz
Configuring for libgd version 2.0.11.
Checking for stray libgd header files...none found.
GD library used from:       /usr/local
Please choose the features that match how libgd was built:
Undefined subroutine &main::prompt called at Build.PL line 169.
Warning: No success on command[/usr/bin/perl Build.PL ]
'YAML' not installed, will not store persistent state
  LDS/GD-2.56.tar.gz
  /usr/bin/perl Build.PL  -- NOT OK
Running Build test
  Make had some problems, won't test
Running Build install
  Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
Failed during this command:
 LDS/GD-2.56.tar.gz                           : writemakefile NO '/usr/bin/perl Build.PL '     returned status 512

Build.PL正在尝试调用一个名为prompt的函数,但它不存在。 这是因为他们最近将构建系统从 ExtUtils::MakeMaker (Makefile.PL( 切换到 Module::Build (Build.PL(,但没有完全转换程序。 我已经报告了该错误。

大多数人没有注意到这一点,因为只有在 GD 无法自行配置时才需要提示。 它通过查找 gdlib-config 程序来做到这一点。 如果找不到,或者它不起作用,它会要求您提供 gdlib 配置。 最好让 gdlib-config 来处理这个问题。 解决此问题的最佳方法是确保 gdlib-config 位于 PATH 中的某个位置并且gdlib-config --all正常工作。

否则,将 Build.PL 中的所有 prompt 实例替换为 Module::Build->prompt,它应该可以工作。

我不确定是否要在 OSX 上执行此操作,但我最近在 CentOS 上安装 CPAN 模块时遇到了类似的问题。

某些先决条件模块根本无法从 CPAN 正确安装。这些模块具有可用的 RPM。通过 yum 安装一些先决条件后,我能够让 CPAN 安装我需要的模块。

特别是,我必须使用 yum 安装 Module-Build 和 Archive-Tar(它带来了许多其他依赖项 rpm(。

希望这有帮助。

最新更新