今天我開始學習Mojolicious框架。恕我直言,最好的方式是「通過實例學習」,所以學習一些「已經完成」的應用程序就可以玩了。因此我下載了Mojolicious-Boilerplate,應該是Mojolicious和Twitter bootstrap的演示。不幸的是,它甚至沒有開始。如何修復Mojolicious-Boilerplate應用程序?
#!/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 - Removed deprecated start method from 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」?
你怎麼開始它?請添加您使用的命令運行代碼 –
@BorisDäppen請參閱編輯 - 謝謝。 – kobame
我也有這樣的問題一次......也許'start'需要用'start_app($ name)'代替:http://mojolicio.us/perldoc/Mojolicious/Commands#start_app –