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

Rack::Server has removed in Rack 3.0 and the server will not start #1473

Closed
kojix2 opened this issue Jan 5, 2023 · 1 comment
Closed

Rack::Server has removed in Rack 3.0 and the server will not start #1473

kojix2 opened this issue Jan 5, 2023 · 1 comment

Comments

@kojix2
Copy link

kojix2 commented Jan 5, 2023

Hello.

Recently Rack::Server was removed from Rack. So in some cases, commands such as yard server -g do not work.
To fix this problem, you need to load a Gem called rackup and change Rack::Server to Rackup::Server.

See minimal code to fix: #1472

Steps to reproduce

yard server -g

Actual Output

<internal:/home/kojix2/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in `require': cannot load such file -- rack/server (LoadError)
	from <internal:/home/kojix2/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
	from <internal:/home/kojix2/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/server/rack_adapter.rb:63:in `start'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/cli/server.rb:51:in `run'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/cli/command.rb:14:in `run'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/cli/command_parser.rb:72:in `run'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/cli/command_parser.rb:54:in `run'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/bin/yard:13:in `<top (required)>'
	from /home/kojix2/.rbenv/versions/3.1.3/bin/yard:25:in `load'
	from /home/kojix2/.rbenv/versions/3.1.3/bin/yard:25:in `<main>'
<internal:/home/kojix2/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- rack/server (LoadError)
	from <internal:/home/kojix2/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/server/rack_adapter.rb:63:in `start'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/cli/server.rb:51:in `run'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/cli/command.rb:14:in `run'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/cli/command_parser.rb:72:in `run'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/lib/yard/cli/command_parser.rb:54:in `run'
	from /home/kojix2/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/yard-0.9.28/bin/yard:13:in `<top (required)>'
	from /home/kojix2/.rbenv/versions/3.1.3/bin/yard:25:in `load'
	from /home/kojix2/.rbenv/versions/3.1.3/bin/yard:25:in `<main>'

Expected Output

>> YARD 0.9.28 documentation server at http://localhost:8808
Rack::Handler is deprecated and replaced by Rackup::Handler
Puma starting in single mode...
* Puma version: 6.0.2 (ruby 3.1.3-p185) ("Sunflower")
*  Min threads: 0
*  Max threads: 5
*  Environment: development
*          PID: 92155
* Listening on http://0.0.0.0:8808
Use Ctrl-C to stop

Environment details:

  • OS: Ubuntu 22.04
  • Ruby version ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
  • YARD version (yard -v): yard 0.9.28

I have read the Contributing Guide.

lsegal added a commit that referenced this issue Jan 6, 2023
@lsegal
Copy link
Owner

lsegal commented Jan 6, 2023

Fixed in 54f1771

@lsegal lsegal closed this as completed Jan 6, 2023
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