如何在Mac OSX 10.6上安装Perl DateTime模块

Ton*_*ams 3 macos perl cpan

好的,我知道如何使用cpan安装Perl模块并且已经使用了多年.但是当我尝试在这个特定的mac上安装DateTime模块时,它失败了,声称它找不到编译器.

以下是尝试安装其中一个先决条件的一些输出,Params :: Validate :(我在尝试安装相关模块时遇到了同样的错误.)

Configuring Params-Validate-1.00
Running Build.PL
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
lipo: can't open input file: /var/tmp//cc3Aefez.out (No such file or directory)
Warning: ExtUtils::CBuilder not installed or no compiler detected
Proceeding with configuration, but compilation may fail during Build
Run Code Online (Sandbox Code Playgroud)

为什么Build.PL正在寻找ppc编译器?如果这是问题我在哪里告诉它(或cpan,或cpanm)这台机器不是ppc盒子?

我跑10.6.8.perl的版本是为darwin-thread-multi-2level构建的v5.10.0

我绝对安装了Developer工具.

我通过sudo运行cpan和cpanm.

我很感激任何人都可以提供帮助.

Dav*_* W. 5

我安装了10.7,安装了Perl 5.12.3.我做了CPAN安装:

$ sudo cpan
password:
cpan> install DateTime
Run Code Online (Sandbox Code Playgroud)

而且,整个事情都有效.这是第三方文件所需要的,或者您是否想要使用它,因为您熟悉这个特定的包?

Perl 5.10有几个内置的Time包.其中一个适合你吗?否则,您可能需要安装并查看是否有帮助.ExtUtils::CBuilder

或者,安装一个更现代的Perl版本,例如ActiveState,安装非常简单,它的cpan实用程序在Mac上工作得很好,它的版本5.14甚至比Lion附带的版本更新.