无法使用cpan在darwin 13.0.1上安装GD模块

时间:2014-12-22 05:49:35

标签: perl gd cpan

我正在努力安装GD。我正在运行Mas OSX 10.9.2 darwin 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

2 个答案:

答案 0 :(得分:4)

Build.PL正在尝试调用名为prompt的函数,但它不存在。这是因为他们最近将构建系统从ExtUtils :: MakeMaker(Makefile.PL)切换到Module :: Build(Build.PL),但没有完全转换程序。我reported the bug

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

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

答案 1 :(得分:0)

我不确定在OSX上这样做,但我最近在CentOS上安装CPAN模块时遇到了类似的问题。

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

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

希望这有帮助。