ArgumentError encountered with nio4r: Unsupported backend when using Puma

I recently performed a bundle update to refresh the development and testing gems in my Gemfile, while keeping the production gems locked to specific versions. The result was that nio4r stayed at version 2.5.2 due to its locked status. However, following the update, I encountered an issue where nio4r threw an error: nio4r-2.5.2/lib/nio/selector.rb:17:in ‘initialize’: unsupported backend: (ArgumentError).

I’m in the process of upgrading both Ruby and Rails, focusing on necessary tests and refactoring my setup before proceeding.

Here’s the output from my Puma server:

Puma is initializing in single-thread mode...
* Puma version: 6.3.0 (ruby 2.7.2-p137) 
*  Minimum threads: 5
*  Maximum threads: 5
*  Environment: development
*          Process ID: 11436
* Serving at http://[::1]:3001
* Serving at http://127.0.0.1:3001
Shutdown in progress
Error Trace:
... 
nio4r-2.5.2/lib/nio/selector.rb:17:in 'initialize': unsupported backend: (ArgumentError)

hey, have u tried exploring if any dependencies’ versions have compatibility issues with nio4r? sometimes, upgrading other gems might slightly nudge dependencies out of sync. Could rolling back or tweaking some of the dependency versions possibly smooth things out? what’s ur current setup look like?

This may be related to the compatibility between Ruby and nio4r. The error usually indicates a mismatch in supported operating system functionalities or Ruby’s internal libraries not playing well together with nio4r’s requirements. Since you are also upgrading Ruby, ensure that the version you move to supports the particular version of nio4r you are using. It might be beneficial to check the changelogs for both nio4r and Puma for any newly reported issues or updates addressing compatibility with recent Ruby versions.