安装Catalyst
下午在Ubuntu上装了Catalyst Web开发框架。从此处下载安装脚本,然后用root执行:
#perl cat-install
如果此时直接运行catalyst.pl,回提示安装Catalyst::Devel。
# catalyst.pl MyApp To use the Catalyst development tools including catalyst.pl and the generated script/myapp_create.pl you need Catalyst::Helper, which is part of the Catalyst-Devel distribution. Please install this via a vendor package or by running one of - perl -MCPAN -e 'install Catalyst::Devel' perl -MCPANPLUS -e 'install Catalyst::Devel' BEGIN failed--compilation aborted at /usr/local/bin/catalyst.pl line 24.
安装Catalyst::Devel。
# perl -MCPAN -e 'install Catalyst::Devel'
使用phillip创建一个具体的实例:
phillip@athens:~$ catalyst.pl MyApp created "MyApp" created "MyApp/script" created "MyApp/lib" created "MyApp/root" created "MyApp/root/static" created "MyApp/root/static/images" created "MyApp/t" created "MyApp/lib/MyApp" created "MyApp/lib/MyApp/Model" created "MyApp/lib/MyApp/View" created "MyApp/lib/MyApp/Controller" created "MyApp/myapp.conf" created "MyApp/myapp.psgi" created "MyApp/lib/MyApp.pm" created "MyApp/lib/MyApp/Controller/Root.pm" created "MyApp/README" created "MyApp/Changes" created "MyApp/t/01app.t" created "MyApp/t/02pod.t" created "MyApp/t/03podcoverage.t" created "MyApp/root/static/images/catalyst_logo.png" created "MyApp/root/static/images/btn_120x50_built.png" created "MyApp/root/static/images/btn_120x50_built_shadow.png" created "MyApp/root/static/images/btn_120x50_powered.png" created "MyApp/root/static/images/btn_120x50_powered_shadow.png" created "MyApp/root/static/images/btn_88x31_built.png" created "MyApp/root/static/images/btn_88x31_built_shadow.png" created "MyApp/root/static/images/btn_88x31_powered.png" created "MyApp/root/static/images/btn_88x31_powered_shadow.png" created "MyApp/root/favicon.ico" created "MyApp/Makefile.PL" created "MyApp/script/myapp_cgi.pl" created "MyApp/script/myapp_fastcgi.pl" created "MyApp/script/myapp_server.pl" created "MyApp/script/myapp_test.pl" created "MyApp/script/myapp_create.pl" Change to application directory and Run "perl Makefile.PL" to make sure your install is complete
按照提示运行‘perl Makefile.PL’完成安装:
phillip@athens:~$ cd MyApp/ phillip@athens:~/MyApp$ perl Makefile.PL
启动Catalyst的Web服务,便于开发调试:
phillip@athens:~/MyApp$ cd script/ phillip@athens:~/MyApp/script$ perl myapp_server.pl
在浏览器中打开http://catalyst_web_server_ip_or_name:3000可以显示页面。
分类: Perl