Don't know. So I assume it works with simple template, but not with Mason?

The stack trace isn't helpful, unfortunately, as it doesn't mention who is 
calling Memoize::flush_cache.

On Oct 4, 2012, at 5:36 AM, Renato Tegon Forti wrote:

> Hi All,
> I am trying run Mason2 on Dancer, but I get “Runtime Error”.
>  
> In apache2 I have modperl and:
>  
> <Location /dacer>
>         SetHandler perl-script
>         PerlHandler Plack::Handler::Apache2
>         PerlSetVar psgi_app /home/ubuntu/MyWeb-App/bin/app.pl
> </Location>
>  
> I have these modules installed as follows:
>  
> curl -L http://cpanmin.us | perl - --sudo Dancer
> cpan -i  Plack::Handler::Apache2
> cpan -i Dancer::Template::Mason2
>  
> In conf: (config.yml)
>  
> # ...
> # simple: default and very basic template engine
> # template_toolkit: TT
>  
> # template: "simple"
> template: 'mason2'
>  
> # ...
>  
> In App:
>  
> vi lib/MyWeb/App.pm
>  
> package MyWeb::App;
> use Dancer ':syntax';
>  
> our $VERSION = '0.1';
>  
> get '/' => sub {
>     template 'index';
> };
>  
>   get '/foo', sub {
>     template 'foo' => {
>         title => 'bar'
>     };
>   };
>  
> get '/hello/:name' => sub {
>     # do something
>  
>     return "Hello ".param('name');
> };
> true;
>  
>  
> Thanks for help.
> Runtime Error
> 
> runtime error
> 
> CODE(0x7f181171dc78) not memoized at /usr/share/perl/5.14/Memoize.pm line 202.
> /usr/share/perl/5.14/Memoize.pm around line 202
> 199 sub flush_cache {
> 200   my $func = _make_cref($_[0], scalar caller);
> 201   my $info = $memotable{$revmemotable{$func}};
> 202   die "$func not memoized" unless defined $info;
> 203   for my $context (qw(S L)) {
> 204     my $cache = $info->{$context};
> 205     if (tied %$cache && ! (tied %$cache)->can('CLEAR')) {
> Stack
> main in -e l. 0
> main in -e l. 0
> Plack::Handler::Apache2 in 
> /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm l. 91
> Plack::Handler::Apache2 in 
> /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm l. 66
> Dancer::Handler in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 123
> Dancer::Handler in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 76
> Dancer::Handler in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 113
> Try::Tiny in /usr/local/share/perl/5.14.2/Try/Tiny.pm l. 100
> Dancer::Exception in /usr/local/share/perl/5.14.2/Dancer/Exception.pm l. 47
> Dancer::Exception in /usr/local/share/perl/5.14.2/Dancer/Exception.pm l. 35
> Dancer::Handler in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 107
> Dancer::Object in /usr/local/share/perl/5.14.2/Dancer/Object.pm l. 16
> Dancer::Error in /usr/local/share/perl/5.14.2/Dancer/Error.pm l. 37
> Dancer::Error in /usr/local/share/perl/5.14.2/Dancer/Error.pm l. 276
> Settings
> {
>   appdir  => '/home/ubuntu/MyWeb-App/bin/..',
>   apphandler  => 'PSGI',
>   appname  => 'MyWeb::App',
>   auto_reload  => '0',
>   charset  => 'utf-8',
>   confdir  => '/home/ubuntu/MyWeb-App/bin/..',
>   content_type  => 'text/html',
>   daemon  => 0,
>   engines  => {},
>   envdir  => '/home/ubuntu/MyWeb-App/environments',
>   environment  => 'development',
>   handlers  => {},
>   import_warnings  => 1,
>   layout  => 'main',
>   log  => 'core',
>   logger  => 'console',
>   plugins  => {},
>   port  => '3000',
>   public  => '/home/ubuntu/MyWeb-App/public',
>   server  => '0.0.0.0',
>   server_tokens  => 1,
>   show_errors  => '1',
>   startup_info  => 1,
>   template  => 'mason2',
>   traces  => 0,
>   views  => '/home/ubuntu/MyWeb-App/views',
>   warnings  => '1'
> }
> Environment
> {
>   DANCER_APPDIR  => '/home/ubuntu/MyWeb-App/bin/..',
>   DOCUMENT_ROOT  => '/var/www',
>   GATEWAY_INTERFACE  => 'CGI/1.1',
>   HTTP_ACCEPT  => 
> 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
>   HTTP_ACCEPT_CHARSET  => 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
>   HTTP_ACCEPT_ENCODING  => 'gzip,deflate,sdch',
>   HTTP_ACCEPT_LANGUAGE  => 'pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4',
>   HTTP_CACHE_CONTROL  => 'max-age=0',
>   HTTP_CONNECTION  => 'keep-alive',
>   HTTP_COOKIE  => 'expected_tab=facebook; 
> welcome_info_name=Renato%20Tegon%20Forti; 
> plack_session=283e3f595178cd9a7c853cc5f2abc229b3606bbd',
>   HTTP_HOST  => 'www.doksafe.com',
>   HTTP_USER_AGENT  => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 
> (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4',
>   HTTP_X_FORWARDED_FOR  => '189.55.11.94',
>   HTTP_X_FORWARDED_PORT  => '80',
>   HTTP_X_FORWARDED_PROTO  => 'http',
>   MOD_PERL  => 'mod_perl/2.0.5',
>   MOD_PERL_API_VERSION  => '2',
>   PATH  => '/usr/local/bin:/usr/bin:/bin',
>   PATH_INFO  => '/foo',
>   PATH_TRANSLATED  => '/var/www/foo',
>   QUERY_STRING  => '',
>   REMOTE_ADDR  => '10.0.3.59',
>   REMOTE_PORT  => '59066',
>   REQUEST_METHOD  => 'GET',
>   REQUEST_URI  => '/dancer/foo',
>   SCRIPT_FILENAME  => '/var/www/dancer',
>   SCRIPT_NAME  => '/dancer',
>   SERVER_ADDR  => '10.0.4.50',
>   SERVER_ADMIN  => 'webmaster@localhost',
>   SERVER_NAME  => 'www.doksafe.com',
>   SERVER_PORT  => '80',
>   SERVER_PROTOCOL  => 'HTTP/1.1',
>   SERVER_SIGNATURE  => '
> Apache/2.2.22 (Ubuntu) Server at www.doksafe.com Port 80
>  
> ',
>   SERVER_SOFTWARE  => 'Apache/2.2.22 (Ubuntu)',
>   'psgi.errors'  => *::STDERR,
>   'psgi.input'  => bless( do{\(my $o = '139741272715424')}, 
> 'Apache2::RequestRec' ),
>   'psgi.multiprocess'  => 1,
>   'psgi.multithread'  => '',
>   'psgi.nonblocking'  => '',
>   'psgi.run_once'  => '',
>   'psgi.streaming'  => 1,
>   'psgi.url_scheme'  => 'http',
>   'psgi.version'  => [
>     1,
>     1
>   ],
>   'psgix.harakiri'  => 1
> }
> Powered by Dancer 1.31
>  
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev_______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to