如何在OSX上安装JSON.pm perl模块 [英] How to install JSON.pm perl module on OSX

查看:186
本文介绍了如何在OSX上安装JSON.pm perl模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用JS gettext库中的po2json解析器/转换器( http://jsgettext.berlios.de /),但是当我尝试进行转换时,出现此错误:

I am trying to use the po2json parser/converter from the JS gettext library (http://jsgettext.berlios.de/), but when I try to convert I get this error:

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,我想就是这样的:

As far as I understand I am missing a perl module, namely JSON.pm, an I think it's this one: http://cpansearch.perl.org/src/MAKAMAKA/JSON-2.53/lib/JSON.pm

现在,如何在OSX上安装它?我正在使用美洲狮.

Now, how do I install it on OSX? I am using Mountain Lion.

我尝试执行cpan install JSON,但是它不起作用,出现以下错误:

I tried to do cpan install JSON, but it doesn't work, I get the following error:

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

推荐答案

输出显示make没有返回成功.可能是由于某种依赖性. 尝试使用cpanm http://search.cpan.org/~miyagawa/App-cpanminus-1.5017/bin/cpanm ,它确实很麻烦,并且引导自如(无需安装其他东西).

The output said that make didn't return success. Probably due to some dependency. Try using cpanm http://search.cpan.org/~miyagawa/App-cpanminus-1.5017/bin/cpanm, it's really hassle free and bootstrapped quite well (no need to install other stuff).

使用此安装:

curl -L http://cpanmin.us | perl - --sudo App::cpanminus

这篇关于如何在OSX上安装JSON.pm perl模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆