'Rails 7 net-protocol and io-wait dependency

I am trying to deploy a webapp in Ruby 3.0.2 and Rails 7.0.1 and I have a problem after deploying it via capistrano in a production server Ubuntu 20.04 with nginx(1.18.0) and passenger(6.0.12).

All the processes work fine but the app can not start in production. I get the passenger error page. Finding in logs I get the next error:

"Error: The application encountered the following error: You have already activated io-wait 0.1.0, but your Gemfile requires io-wait 0.2.1. Since io-wait is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports io-wait as a default gem"

I have tried to remove the gem io-wait but is a default system gem and I cannot remove it, I have upgraded the bundler to the latest (2.3.4) and the error persists. I have added the latest io-wait version (0.2.1) and got the same error.

Any help will be welcome.



Solution 1:[1]

I got it to work by adding

gem "io-wait", "0.1.0"

I then also had the problem with "strscan". Had to downgrade to "3.0.0".

Solution 2:[2]

I was able to get things going by using the following: gem "io-wait", "0.2.0"

Solution 3:[3]

In my gem file I set the two offending gems to the old versions.

gem "io-wait", "0.1.0"
gem "strscan", "3.0.0"

After that, deploying and booting the app worked fine.

Ruby v3.0.2 Rails 7.0.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman
Solution 2 Jim Foley
Solution 3 crimsonknight