GD::GraphのCPANからのインストールに向けて

できない。

# sudo perl -MCPAN -e shell
# install GD::Graph

すると、FTPが失敗する。
Can't use an undefined value as a symbol reference at /System/Library/Perl/5.12/Net/FTP/dataconn.pm line 54.
フォーラム読んでソースを修正してみたけど動かず。

仕方ないからCPANMに切り替えるも

[@ GD-2.46]$sudo cpanm libgd
! Finding libgd on cpanmetadb failed.
! Finding libgd on search.cpan.org failed.
! Finding libgd () on mirror http://search.cpan.org/CPAN failed.
! Couldn't find module or a distribution libgd ()
[@aoki-mba GD-2.46]$cpan GD::Graph
Going to read '/Users/shohei/.cpan/Metadata'
  Database was generated on Sun, 22 May 2011 13:37:59 GMT
Warning: You are not allowed to write into directory "/Users/shohei/.cpan/sources/authors".
    I'll continue, but if you encounter problems, they may be due
    to insufficient permissions.
Fetching with LWP:
ftp://ftp.u-aizu.ac.jp/pub/CPAN/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't use an undefined value as a symbol reference]
Fetching with Net::FTP:
ftp://ftp.u-aizu.ac.jp/pub/CPAN/authors/01mailrc.txt.gz
Can't use an undefined value as a symbol reference at /System/Library/Perl/5.12/Net/FTP/dataconn.pm line 54.

よく覚えてないけど

  • libgd-configが見つからない
  • libgd 2.0.28 or higherをダウンロードしろ

というエラーも出ている。

ソースからgdのインストールを試みる。
http://kempwire.com/tips/installing-gd-graphics-library-on-mac-os-x.html

などをインストールしておく。

肝心のgdは開発中止なのか知らないけどどこにもない。
bitbucketに上がってるのをcloneする(要Mercurialのインストール)
※ちなみにここ(http://www.dmxzone.com/go?6824)を参考にして、



http://www.boutell.com/gd/http/gd-2.0.28.tar.gz


って手打ちしたらソースが落ちてきた。とっていいのかは知らん。

んでGDのインストール。
できたっぽい。

そこで再度cpanmを試みるも、

[@ GD-2.46]$sudo cpanm GD::Graph
--> Working on GD::Graph
Fetching http://search.cpan.org/CPAN/authors/id/B/BW/BWARFIELD/GDGraph-1.44.tar.gz ... OK
Configuring GDGraph-1.44 ... OK
==> Found dependencies: GD::Text
--> Working on GD::Text
Fetching http://search.cpan.org/CPAN/authors/id/M/MV/MVERB/GDTextUtil-0.86.tar.gz ... OK
Configuring GDTextUtil-0.86 ... OK
Building and testing GDTextUtil-0.86 ... FAIL
! Installing GD::Text failed. See /Users/shohei/.cpanm/build.log for details.
! Bailing out the installation for GDGraph-1.44. Retry with --prompt or --force.

/Users//.cpanm/build.log ファイルの中身


Test Summary Report$
 90 -------------------$
 91 t/align.t (Wstat: 512 Tests: 0 Failed: 0)$
 92   Non-zero exit status: 2$
 93   Parse errors: Bad plan.  You planned 21 tests but ran 0.$
 94 t/text.t (Wstat: 512 Tests: 0 Failed: 0)$
 95   Non-zero exit status: 2$
 96   Parse errors: Bad plan.  You planned 20 tests but ran 0.$
 97 t/wrap.t (Wstat: 512 Tests: 0 Failed: 0)$
 98   Non-zero exit status: 2$
 99   Parse errors: Bad plan.  You planned 14 tests but ran 0.$
100 Files=3, Tests=0,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.17 cusr  0    .03 csys =  0.24 CPU)$
101 Result: FAIL$
102 Failed 3/3 test programs. 0/0 subtests failed.$
103 make: *** [test_dynamic] Error 2$
104 -> FAIL Installing GD::Text failed. See /Users/shohei/.cpanm/build.log f    or details.$
105 -> FAIL Bailing out the installation for GDGraph-1.44. Retry with --prom    pt or --force.$

まとめると、自分の環境では、
・cpanmを使う(CPANシェルがNet::FTPで引っかかる)
・GDは知らん

ということで。