Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the default configuration file path for a specified environment? #1265

Closed
ma11hew28 opened this issue Apr 6, 2017 · 4 comments
Closed

Comments

@ma11hew28
Copy link

ma11hew28 commented Apr 6, 2017

According to Puma README: Configuration file:

If an environment is specified . . . through the RACK_ENV environment variable, the default file location will be config/puma/environment_name.rb.

Is this still true for Puma 3.8.2 with Ruby 2.4.1?

@nateberkopec
Copy link
Member

Yes.

@ma11hew28
Copy link
Author

ma11hew28 commented Apr 8, 2017

OK. Sorry. Thank you. :•)

@ma11hew28
Copy link
Author

Hmm... 🤔 When I run the command below, Puma seems to use its default configurations instead of the ones I've specified in config/puma/development.rb.

RACK_ENV=development bundle exec puma --debug

How should I debug this?

@ma11hew28
Copy link
Author

Oh, nice! I found this handy method called p. 🤓

So, I added p @options[:environment] right above lib/puma/configuration.rb:194 and then ran Puma again (with the command in my comment above). And, the output showed that @options[:environment] is a Proc. Huh?

Ahah! It's defined as a lambda literal at lib/puma/configuration.rb:183.

Adding .call to the end of @options[:environment] on line 194 seemed to fix this issue for me.

p to the rescue! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants