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

Crash if config/puma.rb is missing #38

Closed
jodosha opened this issue Jan 22, 2019 · 6 comments
Closed

Crash if config/puma.rb is missing #38

jodosha opened this issue Jan 22, 2019 · 6 comments

Comments

@jodosha
Copy link

jodosha commented Jan 22, 2019

I have a test app without config/puma.rb, and this Guardfile:

guard "puma", port: ENV["HANAMI_PORT"] || 2300 do
  watch(%r{config/*})
  watch(%r{lib/*})
  watch(%r{apps/*})
end

When the app is started, puma crashes because it fails to find config/puma.rb. If I add it, everything works fine.

$ bundle exec guard -n f -i -G Guardfile
12:38:57 - INFO - Using Guardfile at /Users/luca/Code/soundeck/Guardfile.
12:38:57 - INFO - Puma starting on port 2300 in development environment.
12:38:57 - INFO - Guard is now watching at '/Users/luca/Code/soundeck'
Traceback (most recent call last):
	11: from /Users/luca/.gem/ruby/2.6.0/bin/puma:23:in `<main>'
	10: from /Users/luca/.gem/ruby/2.6.0/bin/puma:23:in `load'
	 9: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/bin/puma:8:in `<top (required)>'
	 8: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/bin/puma:8:in `new'
	 7: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/lib/puma/cli.rb:69:in `initialize'
	 6: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/lib/puma/cli.rb:69:in `new'
	 5: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/lib/puma/launcher.rb:59:in `initialize'
	 4: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/lib/puma/configuration.rb:192:in `load'
	 3: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/lib/puma/configuration.rb:192:in `each'
	 2: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/lib/puma/configuration.rb:192:in `block in load'
	 1: from /Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/lib/puma/dsl.rb:41:in `_load_from'
/Users/luca/.gem/ruby/2.6.0/gems/puma-3.12.0/lib/puma/dsl.rb:41:in `read': No such file or directory @ rb_sysopen - --control-token (Errno::ENOENT)
@jc00ke
Copy link
Owner

jc00ke commented Jan 22, 2019

Thanks for reporting, @jodosha. I assume I can recreate with a newly generated Hanami app? If so, I'll take a look, but probably won't have time until this weekend.

@jodosha
Copy link
Author

jodosha commented Jan 23, 2019

@jc00ke A simple Rack app is enough to reproduce the problem. Here's a gist that I prepared for you: https://gist.github.com/jodosha/0f287d613ad753783b787318faf4203d

@jc00ke jc00ke closed this as completed in ac351d6 Jan 28, 2019
@jc00ke
Copy link
Owner

jc00ke commented Jan 28, 2019

@jodosha can you try out master when you get a chance? ac351d6 should fix the issue.

@jodosha
Copy link
Author

jodosha commented Jan 28, 2019

@jc00ke It works as expected. Thanks for fixing it 👍

@AlexWayfer
Copy link
Contributor

@jc00ke, excuse me, but I think that DEFAULT_CONFIG_FILE_PATH should be changed instead of fetch with literal default. I mean… now we have two defaults. For what?

@jc00ke
Copy link
Owner

jc00ke commented Feb 5, 2019

@AlexWayfer yeah, good point, I should probably reorganize some of that logic.

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

3 participants