Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Building a Mojolicious app with PAR::Packer

by Anonymous Monk
on Feb 25, 2011 at 11:31 UTC ( [id://890161]=note: print w/replies, xml ) Need Help??


in reply to Building a Mojolicious app with PAR::Packer

pp comes with options
check these logs
use autodie qw' system '; for my $opts ( "", "-n -x", "-x", "-c" ){ my $out = "use-mojo$opts.exe"; $out =~ s/\s/_/g; my $log = "log-$out.txt"; my $cmd = "pp -v 99 -o $out use-mojo.pl $opts >$log 2>&1 "; print "$cmd\n"; system $cmd; } __END__ pp -v 99 -o use-mojo.exe use-mojo.pl >log-use-mojo.exe.txt 2>&1 pp -v 99 -o use-mojo-n_-x.exe use-mojo.pl -n -x >log-use-mojo-n_-x +.exe.txt 2>&1 pp -v 99 -o use-mojo-x.exe use-mojo.pl -x >log-use-mojo-x.exe.txt + 2>&1 pp -v 99 -o use-mojo-c.exe use-mojo.pl -c >log-use-mojo-c.exe.txt + 2>&1
Now regarding error script: No such file or directory at Mojo/Home.pm line 25 This is line 25 of Mojo/Home.pm
# Environment variable if ($ENV{MOJO_HOME}) { my @parts = File::Spec->splitdir(abs_path $ENV{MOJO_HOME}); $self->{_parts} = \@parts; return $self; }
So there is line number confusion.

Using

require Mojolicious::Lite;
seems to remedy this situation. Oddly BEGIN { eval "use Mojolicious::Lite;" } also works.

Thats bizzare, you should submit a bug report :)

Replies are listed 'Best First'.
Re^2: Building a Mojolicious app with PAR::Packer
by Hue-Bond (Priest) on Feb 25, 2011 at 16:31 UTC

    All of -n -x, -x and -c do the trick and take me to the Mojo/Home.pm line 25 error. I hadn't noticed that the error was precisely in that file: as soon as you pointed it out I remembered that the test t/mojo/home.t had failed before the (forced) installation. Thankfully, Google has something to say about it so I'll now concentrate on that.

    Thank you!

    --
     David Serrano
     (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling errors. Thank you!).

      No line number confusion: abs_path was dying. Turns out that the failing test had nothing to do with it - the problem is caused due to an interference with PAR's runtime environment. Prepending a bit of code to the main script works around the problem:

      use File::Spec; BEGIN { if ($ENV{'PAR_TEMP'}) { my $dir = File::Spec->catfile ($ENV{'PAR_TEMP'}, 'inc'); chdir $dir or die "chdir: '$dir': $!"; } }

      We go to the parent directory of script so now it's properly detected.

      --
       David Serrano
       (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling errors. Thank you!).

        Hello all. Did you alors experienced this kind of error messages with Mojo ? (Did'nt get rid of even while including or creating by hand the epl files)
        Can't open file "Mojolicious\templates\exception.html.ep": No such fil +e or directory at Mojo/Home.pm line 119. Compilation failed in require at Mojolicious.pm line 6. BEGIN failed--compilation aborted at Mojolicious.pm line 6. Compilation failed in require at Mojo/Base.pm line 32.

        Hello all.

        Did you also experience this kind of error messages with Mojo ? (Did'nt get rid of even while including or creating by hand the epl files)
        Can't open file "Mojolicious\templates\exception.html.ep": No such fil +e or directory at Mojo/Home.pm line 119. Compilation failed in require at Mojolicious.pm line 6. BEGIN failed--compilation aborted at Mojolicious.pm line 6. Compilation failed in require at Mojo/Base.pm line 32.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://890161]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-16 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found