Cannot install GD module on darwin 13.0.1 using cpan

邮差的信 提交于 2020-01-11 09:21:10

问题


I'm having a tough job trying to get GD installed. I'm running a Mas OSX 10.9.2 darwin 13.0.1 When I run this: cpan[1]> install GD perl -MCPAN -e shell

I get the follwing error:

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

回答1:


Build.PL is trying to call a function called prompt but it doesn't exist. This is because they recently switched build systems from ExtUtils::MakeMaker (Makefile.PL) to Module::Build (Build.PL) but didn't fully convert the program. I've reported the bug.

Most people don't notice this because the prompting is only necessary if GD can't configure itself. It does this by looking for the gdlib-config program. If that can't be found, or it doesn't work, it will ask you for your gdlib configuration. It's best to let gdlib-config take care of that. Best way to solve this problem is to make sure gdlib-config is somewhere in your PATH and that gdlib-config --all works.

Otherwise replace all the instances of prompt in Build.PL with Module::Build->prompt and it should work.




回答2:


I'm not sure about doing this on OSX, but I recently had similar problems with installing CPAN modules on CentOS.

Some prerequisite modules simply wouldn't install properly from CPAN. These modules had RPMs available. After installing some of the prerequisites via yum, I was able to get CPAN to install the modules I needed.

In particular, I had to install Module-Build and Archive-Tar (which brought in a number of other dependency rpm's) using yum.

Hope this helps.



来源:https://stackoverflow.com/questions/27597167/cannot-install-gd-module-on-darwin-13-0-1-using-cpan

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!