[Catalyst] Newbie needs help with tutorial

John Napiorkowski jjn1056 at yahoo.com
Fri Nov 3 04:22:51 GMT 2006


--- catalyst.20.chsg at spamgourmet.com wrote:

> I'm also returning to Perl programming after
> (joyfully) finding an  
> MVC that's based on a language I've already learned.
> 
> However, in going through the tutorial, I know I've
> screwed up  
> something, somewhere.  When I try to run the server,
> here's what I get:
> 
> $ script/myapp_server.pl
> Couldn't instantiate component
> "MyApp::Model::MyAppDB", "Cannot load  
> schema class 'MyAppDB': syntax error at (eval 99)
> line 1, near  
> "require DBIx::Class:"
>          ...propagated at
> /opt/local/lib/perl5/5.8.8/base.pm line 85.
> BEGIN failed--compilation aborted at
> /Volumes/SHARED/Projects/ 
> Learning/Catalyst/MyApp/script/../lib/MyAppDB.pm
> line 10.
> Compilation failed in require at
> /opt/local/lib/perl5/site_perl/5.8.8/ 
> Catalyst/Model/DBIC/Schema.pm line 272.
> at script/myapp_server.pl line 53" at
> script/myapp_server.pl line 53
> Compilation failed in require at
> script/myapp_server.pl line 53.
> 
> 
> The part that confuses me is "syntax error at (eval
> 99) line 1".    
> What's "(eval 99)" mean?  And if anyone has a clue
> on what's wrong  
> (or even just what files to look at and for what),
> I'd be grateful.

You'll find that a lot of dispatched methods in
Catalyst are wrapped in an eval so that it can catch
errors for you.  'eval 99' is referring to spot in the
evaled code.

I've found that it can be a bit hard to debug what's
going wrong when the DBIx schema classes have errors. 
Try checking that all the required modules are loaded
and so forth.  Use 'perl -c ...' to to a sanity check
on the syntax.  Try paring down the components you are
loading to see if you can ID the missing or troubled
part.  

Start with the DBIx schemas you created, looks like
that is the core of the issue.

--john

> 
> Thanks,
> 
> Conan.
> 
> 
> 
> On Nov 1, 2006, at 3:36 PM, JT Justman -
> jt at signless.com wrote:
> 
> > Richard Wolfe wrote:
> >> Hello all-
> >>
> >> I've been writing (bad) Perl/CGI scripts for
> years, but am just now
> >> trying to get my head around Catalyst (and MVC in
> general). I  
> >> managed to
> >> get Catalyst installed on my little Linux box
> here, and I'm busily
> >> working my way through
> Catalyst::Manual::Tutorial.
> >>
> >> In working my way through Part 2 (Catalyst
> Basics) of the tutorial, I
> >> create my new Catalyst project and start up the
> server and can  
> >> browse to
> >> it no problem. But after I step through all the
> other tasks on this
> >> portion of the tutorial (create a database,
> MyAppDB.pm, the "result
> >> source" files, the controller, etc.) the server
> throws an error  
> >> when I
> >> try to start it:
> >>
> >> [rwolfe at coyote MyApp]$ script/myapp_server.pl
> >> Couldn't instantiate component
> "MyApp::Model::MyAppDB", "Cannot load
> >> schema class 'MyAppDB': Recursive inheritance
> detected while  
> >> looking for
> >> method 'can' in package
> 'DBIx::Class::Componentised' at
> >>
>
/usr/lib/perl5/site_perl/5.8.8/DBIx/Class/Componentised.pm
> line 76.
> >> Compilation failed in require at
> >>
>
/usr/lib/perl5/site_perl/5.8.8/Catalyst/Model/DBIC/Schema.pm
> line  
> >> 272.
> >>  at script/myapp_server.pl line 53" at
> script/myapp_server.pl line 53
> >> Compilation failed in require at
> script/myapp_server.pl line 53.
> >>
> >
> > Well, it sort of looks to my untrained eye like
> some component of your
> > schema is loading either the main Schema class or
> something else.
> >
> > In your MyAppDB.pm file, what do you have in
> load_classes? If it's
> > blank, IIRC it will automatically load all the
> modules in the MyAppDB
> > directory. Perhaps you have something in there you
> didn't mean to  
> > have,
> > such as a copy of MyAppDB.pm? Look carefully at
> each of those classes,
> > and try disabling them one at a time.
> >
> > It may help to check out a copy of the finished
> app from svn to have
> > something to compare to.
> >
> > JT
> >
> > _______________________________________________
> > List: Catalyst at lists.rawmode.org
> > Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> > Searchable archive: http://www.mail-archive.com/ 
> > catalyst at lists.rawmode.org/
> > Dev site: http://dev.catalyst.perl.org/
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
>
http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 



 
____________________________________________________________________________________
Get your email and see which of your friends are online - Right on the New Yahoo.com 
(http://www.yahoo.com/preview) 




More information about the Catalyst mailing list