簡體   English   中英

如何在Mac OSX 10.6上安裝Perl DateTime模塊

[英]How do I install the Perl DateTime module on Mac OSX 10.6

好的,我知道如何使用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

為什么Build.PL正在尋找ppc編譯器? 如果這是問題我在哪里告訴它(或cpan或cpanm)這台機器不是ppc盒子?

我跑10.6.8。 perl的版本是為darwin-thread-multi-2level構建的v5.10.0

我絕對安裝了Developer工具。

我通過sudo運行cpan和cpanm。

我很感激任何人都可以提供幫助。

您使用的是不受支持的Perl。 升級到穩定。

我安裝了10.7,安裝了Perl 5.12.3。 我做了CPAN安裝:

$ sudo cpan
password:
cpan> install DateTime

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

Perl 5.10有幾個內置的Time包。 其中一個適合你嗎? 否則,您可能需要安裝ExtUtils::CBuilder並查看是否有幫助。

或者,安裝一個更現代的Perl版本,例如ActiveState ,安裝非常簡單,它的cpan實用程序在Mac上工作得很好,它的版本5.14甚至比Lion附帶的版本更新。

我認為正在發生的事情是安裝程序正在嘗試編譯某些東西(可能是一個XS模塊)並且要做到這一點,它需要使用相同的編譯器來編譯你的系統上任何版本的Perl,它無法找到它。 您最好的選擇是使用perlbrew安裝自己的Perl 5.10版本,因為編譯器可用(請確保您編輯.profile以便終端使用您的新Perl),然后重新打開終端,切換到Perlbrew版本Perl 5.10,從那時起你應該沒問題。

如果你在安裝perlbrew Perl時遇到問題,那么就像上面提到的daxim一樣,請參考Lion修復程序

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM