I just upgraded from ruby 2.6 to 3.1.2 and from a mySQL 5 DB to MariaDB 10.6.7
I now get this ServerGoneError when I do a query. I was originally connecting via the loopback interface, but for MariaDB, have switched to using the socket.
As a test, I installed the mysql2 gem, and it works fine with the same code. The only downside is that mysql2 doesn't expose the table names, so if I do switch gems, I will need to rewrite multi-table queries and the code that handles them.