Figured out the problem...

I had actually installed my app library into @INC as App::EnvUI, and in my test file, it was loading that one. In that path, the library was obviously not able to find a config file relative to its location.

If I hadn't of actually installed the module into the system, I would have gotten a Can't locate App/EnvUI.pm in @INC, instead, it was loading the @INC file, complaining about no DB info, as it couldn't read a config file.

The answer was to add:

use FindBin; use lib "$FindBin::Bin/../lib";

To the top of the test file, prior to use App::EnvUI;. That forced the test file to load the application library that's relative to itself, in the application dir structure, instead of the one in @INC, and of course, it knew exactly where to grab the config file from.

So, it was my fault. Because Dancer2 doesn't require a config file, it won't error out if it can't find one, which led to the confusion as to what was going on.

In the end, I figured out that no config file was loaded by putting a print Dumper $dsl; on line 514 of Dancer2::Plugin. In the test run, the config_file directive was an empty array ref, but in the normal run, it had the proper config file listed as an element in the aref. I realized at that time that it was the environment that was wrong, not any code.


In reply to Re: Default DB connection details not found: Plack::Test & Dancer2 by stevieb
in thread [SOLVED] Default DB connection details not found: Plack::Test & Dancer2 by stevieb

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.