G'day All,

I have created and deployed a Dancer2 ($work) application. This is successful, I'm not looking for help with this. While doing this I encountered a problem (described below) and found a workaround. My question is why this workaround was required at all.

I initially created the application which had a file structure similar to what's shown in "Dancer2::Tutorial - Creating a new app". There was one module (let's say Private::Work::Module) in lib/Private/Work/Module.pm with tests in the standard t/ directory: make, make test and make install were all OK. I ran this standalone as 'plackup -p 5000 /path/to/script.psgi': everything worked fine.

The next step was deployment. I've basically used what's described in "Dancer2::Manual::Deployment - Running under Apache - With Plack". I copied what I considered were the appropriate files to /srv/www/ directories: I excluded all make-, git- and distribution-related files, as well as the complete lib/ and t/ directories.

When I tried the URL from a variety of browsers (including graphical Firefox and textual lynx) I got "500 Internal Server Error".

I finally tracked down the issue and, after copying the lib/ directory to the apropriate /srv/www/ directory, everything worked fine and all tests on the application were successful.

I will just note that I successfully tried 'use Private::Work::Module; print "$Private::Work::Module::VERSION\n"' as a non-root user from a directory unrelated to my source directory, any Apache directory, or any @INC directory.

So, why does the lib/ directory need to be bundled with the Dancer2 files? Other Perl modules that I used — core, CPAN, and Private::OtherWork::OtherModule — were all found, loaded and used without any problems.

— Ken


In reply to Dancer2: Why is bundled 'lib/' required? by kcott

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.