@kyanny's blog

My thoughts, my life. Views/opinions are my own.

Leopard で Sledge を動かしてみたが・・・

なんかヤバいところでハマってしまったような

[Thu Jul  3 21:32:38 2008] [error] Can't load '/System/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Time/HiRes/HiRes.bundle' for module Time::HiRes: dlopen(/System/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Time/HiRes/HiRes.bundle, 1): no suitable image found.  Did find:\n\t/System/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/Time/HiRes/HiRes.bundle: no matching architecture in universal wrapper at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/DynaLoader.pm line 230, <GEN0> line 5.\n at /Library/Perl/5.8.8/Sledge/Session.pm line 11\nCompilation failed in require at /Library/Perl/5.8.8/Sledge/Session.pm line 11, <GEN0> line 5.\nBEGIN failed--compilation aborted at /Library/Perl/5.8.8/Sledge/Session.pm line 11, <GEN0> line 5.\nCompilation failed in require at (eval 40) line 3, <GEN0> line 5.\n\t...propagated at /System/Library/Perl/5.8.8/base.pm line 85, <GEN0> line 5.\nBEGIN failed--compilation aborted at /Library/Perl/5.8.8/Sledge/Session/DBI.pm line 9, <GEN0> line 5.\nCompilation failed in require at (eval 39) line 3, <GEN0> line 5.\n\t...propagated at /System/Library/Perl/5.8.8/base.pm line 85, <GEN0> line 5.\nBEGIN failed--compilation aborted at /Library/Perl/5.8.8/Sledge/Session/MySQL.pm line 9, <GEN0> line 5.\nCompilation failed in require at /Users/kyanny/workdir/blogger_relation/lib/LDBlogNG/Pages.pm line 9, <GEN0> line 5.\nBEGIN failed--compilation aborted at /Users/kyanny/workdir/blogger_relation/lib/LDBlogNG/Pages.pm line 9, <GEN0> line 5.\nCompilation failed in require at (eval 31) line 3, <GEN0> line 5.\n\t...propagated at /System/Library/Perl/5.8.8/base.pm line 85, <GEN0> line 5.\nBEGIN failed--compilation aborted at /Users/kyanny/workdir/blogger_relation/lib/LDBlogNG/Pages/Admin/BloggerRelation/Campaigns.pm line 3, <GEN0> line 5.\nCompilation failed in require at /Library/Perl/5.8.8/Sledge/Dispatcher/Properties.pm line 38, <GEN0> line 5.\n

まず、 mod_perl2 が標準で入っているが Sledge には mod_perl1 が必要なので mod_perl-1.30 と apache_1.3.41 を入れる。

次に依存モジュールを入れるが、 Apache::Request (libapreq) の 1.33 とかが入らない。 Makefile.PL のなかで $mod_perl::VERSION を判別して 2.x があったら die しているのだが、 BEGIN ブロックのなかで require mod_perl するより先に $mod_perl::VERSION を評価すると 2.x の数字がでてしまう。なんだろう不思議。 Perl のバイナリ自体になにかあるのだろうか。

ここはしょうがないので die する行をコメントアウトして無理矢理入れた。ちなみにもとからある mod_perl2 は /System/Library 以下に、あとから入れた mod_perl1 なりは /Library 以下のそれぞれ適切なパスに入るので衝突はしない。

ここまでできて Sledge が CGI ではちゃんと動き、 Sledge::Dispatcher を入れてみると、上のような嫌な感じのエラーが。ぐぐると id:lopnor さんが似たような状況でひっかかったときのログが。他のぐぐる結果をみると、 Perl というより darwin のほうとのからみででる問題のようで、深追いするのは辛そう。どうしよう・・・。

「macports の Perl で mod_perl なり apache なりを作るとうまくいく」という情報を教えてもらった。なるほどそういう手がありますか・・・。ぐぐってでてきたなんとなくそれっぽい情報をみても、 universal binary がどうとかいうあたりでひっかかってる気配なので、そういうことなのかもしれないなぁ。でもあんまり入れたくないなぁ。。