[dancer-users] Mig Dancer 1 to 2: set confdir does not work?

Warren Young wyml at etr-usa.com
Tue May 24 13:56:47 BST 2016


On May 24, 2016, at 3:03 AM, Jochen Schnuerle <js at betabox.de> wrote:
> 
> I want a clean root dir and so I move the rest of the files to the new doc dir.

Those aren’t documentation files, they’re build and packaging files.

If you don’t want them, you can just remove them.

> So I think Dancer2 cannot find the config.yml file.

You’re probably right.

> I read that I must create a .dancer file in the etc dir:

Read where?  I’ve never heard of that feature, and I can’t find it in the four most plausible Dancer2 documentation files.  (Which was my point back when the subject of documentation came up last time: too many places to look!)

Anyway, by grepping the sources, I found that this only appears once, in 

  Dancer2/Core/Role/HasLocation.pm

It is inside a loop that works by walking up the directory hierarchy, not down.  That is, the .dancer trick would only work for a case like:

   project
       subdir/.dancer
          subsubdir

…when you start your app from subsubdir, and it fails to find ‘bin’ or ‘lib’ in that directory.  It goes up one level, finds the .dancer file, and assumes that is the root of the project, as far as Dancer is concerned.  Your scheme doesn’t work because it is *below* the current working directory you run plackup within, not above it.

(Incidentally, the comment above the line in question doesn’t match the action of the line it is commenting on!)


More information about the dancer-users mailing list