aquadrops *

Technologies and Labs, Lifelog and more.

2008-04-02

LeopardにCatalyst環境を整えてみた

今日はちょっと気分転換にPerl on RailsなCatalystの環境を作ってみた。

連日環境ばかり作ってる気がするけど(´・ω・)

Mac Catalyst」でググってもCicsoのスイッチのしか出てこない;

で、インストールはCPANシェルで行います。

Test::Podモジュールを入れて、本体をインストール。

とってもシンプルですね。

$ sudo perl -MCPAN -e ‘install Test::Pod’

$ sudo perl -MCPAN -e ‘install Test::Pod::Coverage’

$ sudo perl -MCPAN -e ‘install Task::Catalyst’

本体をインストールする時にmakeエラーになってたので何度か繰り返してたらうまく行った^ー^;

いいのかそれで…

動作確認してみる。

AquadropsApp というプロジェクトを作る。

$ catalyst.pl AquadropsApp

created “AquadropsApp”

created “AquadropsApp/script”

created “AquadropsApp/lib”

created “AquadropsApp/root”

created “AquadropsApp/root/static”

created “AquadropsApp/root/static/images/uploads”

created “AquadropsApp/t”

created “AquadropsApp/lib/AquadropsApp”

created “AquadropsApp/lib/AquadropsApp/Model”

created “AquadropsApp/lib/AquadropsApp/View”

created “AquadropsApp/lib/AquadropsApp/Controller”

created “AquadropsApp/aquadropsapp.yml”

created “AquadropsApp/lib/AquadropsApp.pm”

created “AquadropsApp/lib/AquadropsApp/Controller/Root.pm”

created “AquadropsApp/README”

created “AquadropsApp/Changes”

created “AquadropsApp/t/01app.t”

created “AquadropsApp/t/02pod.t”

created “AquadropsApp/t/03podcoverage.t”

created “AquadropsApp/root/static/images/uploads/catalyst_logo.png”

created “AquadropsApp/root/static/images/uploads/btn_120x50_built.png”

created “AquadropsApp/root/static/images/uploads/btn_120x50_built_shadow.png”

created “AquadropsApp/root/static/images/uploads/btn_120x50_powered.png”

created “AquadropsApp/root/static/images/uploads/btn_120x50_powered_shadow.png”

created “AquadropsApp/root/static/images/uploads/btn_88x31_built.png”

created “AquadropsApp/root/static/images/uploads/btn_88x31_built_shadow.png”

created “AquadropsApp/root/static/images/uploads/btn_88x31_powered.png”

created “AquadropsApp/root/static/images/uploads/btn_88x31_powered_shadow.png”

created “AquadropsApp/root/favicon.ico”

created “AquadropsApp/Makefile.PL”

created “AquadropsApp/script/aquadropsapp_cgi.pl”

created “AquadropsApp/script/aquadropsapp_fastcgi.pl”

created “AquadropsApp/script/aquadropsapp_server.pl”

created “AquadropsApp/script/aquadropsapp_test.pl”

created “AquadropsApp/script/aquadropsapp_create.pl”

webサーバーは自動生成してくれるので、起動してみる。

デフォルトは3000ポートなのですが、WEBRickが使ってるので、3001番ポートにして起動。

$ ./AquadropsApp/script/aquadropsapp_server.pl -r -p 3001

[debug] Debug messages enabled

[debug] Statistics enabled

[debug] Loaded plugins:

.—————————————————————————-.

| Catalyst::Plugin::ConfigLoader 0.19 |

| Catalyst::Plugin::Static::Simple 0.20 |

‘—————————————————————————-‘

[debug] Loaded dispatcher “Catalyst::Dispatcher”

[debug] Loaded engine “Catalyst::Engine::HTTP::Restarter”

[debug] Found home “/Applications/MAMP/htdocs/AquadropsApp”

[debug] Loaded Config “/Applications/MAMP/htdocs/AquadropsApp/aquadropsapp.yml”

[debug] Loaded components:

.—————————————————————–+———-.

| Class | Type |

+—————————————————————–+———-+

| AquadropsApp::Controller::Root | instance |

‘—————————————————————–+———-‘

[debug] Loaded Private actions:

.———————-+————————————–+————–.

| Private | Class | Method |

+———————-+————————————–+————–+

| /default | AquadropsApp::Controller::Root | default |

| /end | AquadropsApp::Controller::Root | end |

‘———————-+————————————–+————–‘

[info] AquadropsApp powered by Catalyst 5.7012

You can connect to your server at http://macintosh.local:3001

ブラウザでアクセスしてみます。

http://localhost:3001/

動いたー

Aptanaで開発できんものかと思ってたのですが、できないようですね。(あったらすいません)