Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


require_environment causes failure if environment is already loaded #961

sapphirecat opened this Issue · 4 comments

2 participants


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 bin/ 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.


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...


Please try this: sapphirecat/dancer961

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



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

@yanick yanick closed this in 0548ca0

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.