Mac CPAN

開発用にMac miniを買って、eclipseなどインストールしたところ、perlスクリプトにJcodeが見えないというエラーが。せっかくだからJcodeをインストール。

bash-3.2$ sudo perl -MCPAN -e shell
cpan[1]> install Jcode

ついでにinstall Pgもしたがエラー。

cpan[3]> install Pg
Running install for module 'Pg'
Running make for M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz
Checksum for /Users/yano/.cpan/sources/authors/id/M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz ok

CPAN.pm: Going to build M/ME/MERGL/pgsql_perl5-1.9.0.tar.gz

Configuring Pg
Remember to actually read the README file !
please set environment variables POSTGRES_INCLUDE and POSTGRES_LIB !
Warning: No success on command[/usr/bin/perl Makefile.PL]
MERGL/pgsql_perl5-1.9.0.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Failed during this command:
MERGL/pgsql_perl5-1.9.0.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL' returned status 65280

cpan[4]>

cpan[1]> install XML::SAX::Expat
cpan[1]> install XML::Simple

sh-3.2# export POSTGRES_LIB=/usr/lib64
sh-3.2# export POSTGRES_INCLUDE=/usr/include/pgsql

して、さらに、

cpan[2]> force install Pg

でインストールできた。