我正在尝试使用JS gettext库中的po2json解析器/转换器(http://jsgettext.berlios.de/),但是当我尝试进行转换时,出现了以下错误:
Can't locate JSON.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.4 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at ./po2json line 23.
BEGIN failed--compilation aborted at ./po2json line 23.
据我所知,我缺少一个Perl模块,即JSON.pm,我认为它是这个:http://cpansearch.perl.org/src/MAKAMAKA/JSON-2.53/lib/JSON.pm。
那么,我该如何在OSX上安装它?我正在使用Mountain Lion。
我尝试运行
cpan install JSON
,但它不起作用,我得到以下错误:Writing Makefile for JSON
MAKAMAKA/JSON-2.53.tar.gz
make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
cpanm install JSON
(不需要sudo
)对我来说可行。 - Dave Yarwood