Skip to content

Instantly share code, notes, and snippets.

@memowe
Created April 6, 2011 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save memowe/905941 to your computer and use it in GitHub Desktop.
Save memowe/905941 to your computer and use it in GitHub Desktop.
WTF: Can't locate object method "search" via "Mojolicious::Lite" at Foo.pm line 6
#!/usr/bin/env perl
use Mojolicious::Lite;
use Foo;
get '/' => sub { shift->render_text(ref Foo->new->bar) };
app->start;
package Foo;
use Mojo::Base -base;
use Mojo::Loader;
has bar => sub { Mojo::Loader->new->search('Bar') };
1;
$ perl foo.pl daemon --reload
Wed Apr 6 18:08:35 2011 info Mojo::Server::Daemon:319 [14089]: Server listening (http://*:3000)
Server available at http://*:3000.
Wed Apr 6 18:08:37 2011 debug Mojolicious:22 [14089]: Your secret passphrase needs to be changed!!!
Wed Apr 6 18:08:37 2011 debug Mojolicious::Plugin::RequestTimer:24 [14089]: GET / (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0).
Wed Apr 6 18:08:37 2011 debug Mojolicious::Routes:418 [14089]: Dispatching callback.
Wed Apr 6 18:08:37 2011 error Mojolicious::Routes:434 [14089]: Can't locate object method "search" via "Mojolicious::Lite" at Foo.pm line 6
Wed Apr 6 18:08:37 2011 error Mojolicious::Controller:318 [14089]: Can't locate object method "search" via "Mojolicious::Lite" at Foo.pm line 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment