[Catalyst] Problem with 'login' method in tutorial

Matt S Trout dbix-class at trout.me.uk
Fri Jun 23 01:57:33 CEST 2006


Peter Traub wrote:
> 
> 
> On 6/22/06, *Matt S Trout* <dbix-class at trout.me.uk 
> <mailto:dbix-class at trout.me.uk>> wrote:
> 
>     Peter Traub wrote:
>      > Hello,
>      >
>      > I'm a Catalyst newbie stuck on the tutorial with following
>     problem. In
>      > the Users.pm <http://Users.pm> <http://Users.pm > file, the login
>     function fails, as the
>      > call to $c->login() gets the following error:
>      >
>      > [Thu Jun 22 15:57:00 2006] [catalyst] [error] Caught exception "Can't
>      > locate object method "login" via package "tutorial" at
>      >
>     /home/peter/public_html/tutorial/script/../lib/tutorial/Controller/Users.pm
>      > line 82."
>      >
>      > This would normally imply that I'm missing modules, however, I have
>      > installed all the necessary plugins through CPAN (as far as I can
>     tell).
>      > One possible cause, but I don't think it is normally an issue, is
>     that
>      > the Catalyst plugins on my machine (running Ubuntu 'dapper
>     drake'), are
>      > in two directories. One directory (/usr/share/perl5/Catalyst/)
>     has a few
>      > plugins provided by Ubuntu's apt repository. The other directory
>      > (/usr/local/share/perl/5.8.7/Catalyst/) has the new plugins installed
>      > with CPAN. Both directories are in @INC when printed from the
>     tutorial
>      > app. I tried copying the CPAN installed plugins
>      > (Authentication::Credential::Password, Authentication::Simple,
>     etc.) to
>      > the Ubuntu perl dir, but it made no difference. I did restart the
>     test
>      > server on each change.
>      >
>      > At this point, I'm not quite sure what else to do to get the app
>     to see
>      > Authentication::Credential::Password which apparently provides the
>      > 'login' method. A search of Google and the list archives hasn't
>     turned
>      > up anyone with the same problem. Any suggestions/help would be
>     greatly
>      > appreciated. Also, at the end of this email I've included a dump
>     of my
>      > $c object from right before the login call fails. Many thanks.
> 
>     cain$ perl -MCatalyst::Plugin::Authentication::Credential::Password
>     -e 'print
>     "Yay" if
>     Catalyst::Plugin::Authentication::Credential::Password->can("login");'
>     Yay
> 
> 
> Strange. It doesn't print Yay. However, perl -e 'use 
> Catalyst::Plugin::Authentication::Credential::Password' also doesn't 
> complain, so it is there.

Ok. Now use perldoc -l to find out where it is and go see if there's anything 
odd about that file. If it isn't, I'd politely suggest this isn't Catalyst's 
fault and something REALLY WEIRD is going on with your system :)

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list