We’re on 7.0.8, and I’m trying to upgrade to 7.1.2. When I run rspec, I get a bunch of these warnings:
Rack::Handler is deprecated and replaced by Rackup::Handler
What am I doing wrong?
How can I make this go away?
We’re on puma (6.4.0), rack (3.0.8), rackup (2.1.0), railties (7.1.2)
I go this same error. The error is emitted by the rackup gem if using the older
Rack::Server class instead of the renamed
Rackup::Server class. This was part of Rack doing a bit of re-org and splitting off the rackup gem. See the upgrade guide for more info.
For me the source was an extension to the
Rack::Server by rails_semantic_logger. For you it might be some other gem. How I found this was:
bundle info rackup to find where rackup is installed
- At that location edit the
lib/rack/server.rb file by putting
warn caller prior to the
- Run the application. Where you previously just got the warning you now get a whole backtrace making it easy to see who is referencing
Rack::Server instead of
- Follow up with the offending gem with a PR to help us all. (still on my todo list for rails_semantic_logger)
- Don’t forget to remove
puts caller from your installation of the rackup gem.
In my case this was caused by capybara/registrations/server.rb. It does not appear to be a major issue at the moment since Rackup redirects the request to Rackup::Handler. I wonder how long that will last?