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

Raise an error when no available Rack server was found #1836

Merged
merged 1 commit into from Dec 28, 2022

Conversation

mishina2228
Copy link
Contributor

@mishina2228 mishina2228 commented Sep 21, 2022

Fix #1835

This PR will display a message indicating that no available Rack server was found.

After this change:

  • Gemfile:
    source "https://rubygems.org"
    
    gem 'resque'
  • Output:
    $ bundle exec resque-web --foreground
    bundler: failed to load command: resque-web (/home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bin/resque-web)
    /home/owner/git-repos/resque/lib/resque/web_runner.rb:296:in `setup_rack_handler': No available Rack handler (e.g. WEBrick, Thin, Puma, etc.) was found. (RuntimeError)
            from /home/owner/git-repos/resque/lib/resque/web_runner.rb:33:in `initialize'
            from /home/owner/git-repos/resque/bin/resque-web:15:in `new'
            from /home/owner/git-repos/resque/bin/resque-web:15:in `<top (required)>'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bin/resque-web:25:in `load'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bin/resque-web:25:in `<top (required)>'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `load'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `kernel_load'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:23:in `run'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli.rb:486:in `exec'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli.rb:31:in `dispatch'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli.rb:25:in `start'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/exe/bundle:48:in `block in <top (required)>'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
            from /home/owner/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/exe/bundle:36:in `<top (required)>'
            from /home/owner/.rbenv/versions/3.1.2/bin/bundle:25:in `load'
            from /home/owner/.rbenv/versions/3.1.2/bin/bundle:25:in `<main>'
    
  • Error message:
    No available Rack handler (e.g. WEBrick, Thin, Puma, etc.) was found.
    

@PatrickTulskie
Copy link
Contributor

@mishina2228 also with this one can you rebase on master and I think this one can get merged in pretty easily.

@mishina2228
Copy link
Contributor Author

@PatrickTulskie Done. Thanks for the review!

@PatrickTulskie PatrickTulskie merged commit 51f4994 into resque:master Dec 28, 2022
@mishina2228 mishina2228 deleted the raise-when-no-rack-server branch December 28, 2022 06:59
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

Successfully merging this pull request may close these issues.

Standalone resque-web without a Rack server raises NoMethodError
2 participants