more useful options | |
PerlMonks |
Dancer2: Why is bundled 'lib/' required?by kcott (Archbishop) |
on Feb 01, 2022 at 22:03 UTC ( [id://11141027]=perlquestion: print w/replies, xml ) | Need Help?? |
kcott has asked for the wisdom of the Perl Monks concerning the following question: 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
Back to
Seekers of Perl Wisdom
|
|