Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

require_environment causes failure if environment is already loaded #961

Closed
sapphirecat opened this Issue · 4 comments

2 participants

@sapphirecat

In Dancer::Config the logic reads like:

if (environment file exists and is not loaded) { load it; }
elsif (require_environment is set) { fail; }

I am launching my app with plackup -s Starman -E development -l 127.0.0.1:9002 bin/app.pl and it appears that load gets called twice for some reason. The second time through, the environment has been loaded, so the first branch is false and the second is taken.

The error message then points to a perfectly fine and loadable YAML file, which can be rather confusing.

$Dancer::VERSION is 1.3118, and I installed it from CPAN last week via cpanm. Other major components in use are Plack 1.0029 and Starman 0.4008.

@yanick
Owner

Could you provide a small example showing that problem? I've created an app using 'dancer -a foo', set 'require_environment' to be true in the config.yml, and started the whole thing via plackup, and it's all happy for me...

@sapphirecat

Please try this: sapphirecat/dancer961

I think I've hacked it down to perfection...

@yanick
Owner

...

This is the best bug example evar. You're awesome.

@yanick yanick closed this in 0548ca0
@yanick
Owner

Bug found and eradicated. It'll be part of the next release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.