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

Auto-detect config file #438

Closed
mperham opened this issue Jan 17, 2014 · 6 comments
Closed

Auto-detect config file #438

mperham opened this issue Jan 17, 2014 · 6 comments
Labels

Comments

@mperham
Copy link

mperham commented Jan 17, 2014

If I run bin/puma, I'd like it to auto-detect and use config/puma.rb to configure and boot Rails. I'm trying to reduce development friction as much as possible, making the command as easy as possible to start. Running bin/rails makes WEBrick easy but we want to test locally with puma where possible. This will make puma one character simpler than WEBrick, thus winning the battle of the development servers. QED

@mperham
Copy link
Author

mperham commented Jan 17, 2014

Looks like puma changes the default development logging when started this way:

$ bin/puma -C config/puma.rb 
[20512] Puma starting in cluster mode...
[20512] * Version 2.7.1, codename: Earl of Sandwich Partition
[20512] * Min threads: 2, max threads: 4
[20512] * Environment: development
[20512] * Process workers: 2
[20512] * Phased restart available
[20512] * Listening on tcp://0.0.0.0:3000
[20512] Use Ctrl-C to stop
[20512] - Worker 20514 booted, phase: 0
[20512] - Worker 20513 booted, phase: 0
[20513] 127.0.0.1 - - [17/Jan/2014 09:23:06] "GET / HTTP/1.1" 200 - 3.5813
[20513] 127.0.0.1 - - [17/Jan/2014 09:23:06] "GET /application.css?body=1 HTTP/1.1" 304 - 0.0787
[20513] 127.0.0.1 - - [17/Jan/2014 09:23:06] "GET /application3.css?body=1 HTTP/1.1" 304 - 0.0600
[20513] 127.0.0.1 - - [17/Jan/2014 09:23:06] "GET /jquery.tools.min.all-1.2.6.js?body=1 HTTP/1.1" 304 - 0.0534
[20513] 127.0.0.1 - - [17/Jan/2014 09:23:06] "GET /jquery_ujs.js?body=1 HTTP/1.1" 304 - 0.0742

but not when we start it via bin/rails s puma. How do we use a config file while also getting normal Rails development stdout logging?

@mperham
Copy link
Author

mperham commented Jan 17, 2014

Any thoughts about setting puma as the default server, a la unicorn-rails? We love it.

https://github.com/samuelkadolph/unicorn-rails/blob/master/lib/unicorn/rails.rb#L35

@catsby
Copy link
Contributor

catsby commented Jan 17, 2014

Would that require a separate gem, puma-rails or similar? Or something into Rails, like how Rails will pick up Thin automatically? I would love to see the latter.

@mperham
Copy link
Author

mperham commented Jan 17, 2014

I'd prefer not to require a separate gem. I don't know why an app would have multiple app servers bundled but maybe there's a rare edge case.

@evanphx
Copy link
Member

evanphx commented Jan 25, 2014

@mperham With regards to setting Puma as the default, Rack will find puma automatically already (rack/rack@e6284a3). Do you think more is needed?

@mperham
Copy link
Author

mperham commented Jan 26, 2014

Sounds good, we're probably on an old rack version.

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

No branches or pull requests

3 participants