开发者

Why can't my CPAN client from MacPorts find Module::Build?

I am using the macports in snow leopard. I wanted to install certain perl modules to be able to run a script. The DateTime module to be exact. How do I do this? I tried using the following command.

开发者_C百科
perl -MCPAN -e shell
cpan > install DateTime

But it still says that DateTime.pm not found. What have I done wrong?

Edit: I think I have not configured CPAN properly. I got the error

Can't locate Module/Build.pm in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level /opt/local/lib/perl5/site_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.9 /opt/local/lib/perl5/vendor_perl /opt/local/lib/perl5/5.8.9/darwin-2level /opt/local/lib/perl5/5.8.9 .) at Build.PL line 5.
BEGIN failed--compilation aborted at Build.PL line 5.
Warning: No success on command[/opt/local/bin/perl Build.PL ]
Warning (usually harmless): 'YAML' not installed, will not store persistent state
  DROLSKY/DateTime-0.61.tar.gz
  /opt/local/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 '/Users/xxxxxx/.cpan/build/DateTime-0.61-ZNYzBn/META.yml'. Falling back to other methods to determine prerequisites
  Warning: CPAN.pm discovered Module::Build as undeclared prerequisite.
  Adding it now as such.

Do I need to do something else first?


Easiest solution, since you're using perl from macports, install DateTime from macports as well:

sudo port install p5-datetime


DateTime uses META.json - it is not yet supported. So install Module::Build first. Upgrading CPAN is also a good idea.


You'd better check your firewall configuration. CPAN's access to servers may be blocked. Anyway, you can download and manually install the module: http://search.cpan.org/dist/DateTime/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜