Question

Today I started to learn the Mojolicious framework. IMHO, the best way is "learn by examples", so study some "already done" application a play with it. Therefore I downloaded the Mojolicious-Boilerplate, what should be a demo of Mojolicious and Twitter bootstrap. Unfortunately it doesn't even start.

#!/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;

EDIT start & error:

$ 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.

I found in the https://github.com/kraih/mojo/blob/master/Changes :

3.94 2013-04-08 - Removed deprecated start method from Mojolicious::Commands.

Have:

$ 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!
  • Can please anybody suggest me how to fix this starter app?
  • Or is here another "simple" app what shows some js,css,mojolicious "broilerplate"?
Was it helpful?

Solution

As you mentioned yourself, the start method was deprecated and is now removed. The replacement for it is start_app($name) as you can find here: http://mojolicio.us/perldoc/Mojolicious/Commands#start_app

The example you are playing with is simply not up-to-date. If you brought it running on your machine you could make a pull-request to the official Git-repository (as G. Cito mentioned). I'm sure they will be glad receiving this fix.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top