今天开始学习 Mojolicious 框架。恕我直言,最好的方法是“通过示例学习”,因此请研究一些“已经完成”的应用程序。因此我下载了Mojolicious-Boilerplate,应该是 Mojolicious 和 Twitter 引导程序的演示。不幸的是,它甚至没有开始。
#!/usr/bin/env perl
use Mojo::Base -strict;
use File::Basename 'dirname';
use File::Spec;
push @INC, join('/', File::Spec->splitdir(dirname(__FILE__)), '..', 'lib');
# Check if Mojolicious is installed;
die <<EOF unless eval 'use Mojolicious::Commands; 1';
It looks like you don't have the Mojolicious framework installed.
Please visit http://mojolicio.us for detailed installation instructions.
EOF
# Application
$ENV{MOJO_APP} ||= 'Boilerplate';
# Start commands
Mojolicious::Commands->start;
编辑开始和错误:
$ morbo script/boilerplate
Couldn't load application from file "script/boilerplate": Can't locate object method "start" via package "Mojolicious::Commands" at script/boilerplate line 20.
我在https://github.com/kraih/mojo/blob/master/Changes中找到:
3.94 2013-04-08 - 从 Mojolicious::Commands 中删除了已弃用的启动方法。
有:
$ mojo version
CORE
Perl (v5.16.3, darwin)
Mojolicious (4.18, Top Hat)
OPTIONAL
EV 4.0+ (4.15)
IO::Socket::IP 0.16+ (0.21)
IO::Socket::SSL 1.75+ (1.952)
This version is up to date, have fun!
- 有人可以建议我如何修复这个入门应用程序吗?
- 或者这里是另一个“简单”的应用程序,它显示了一些js、css、mojolicious “broilerplate”?