Switch branch builds to Ruby 3.1

Related to gitlab-org&10034 (closed). Once the Gem audit is complete and we have tackled all known issues, switch the feature branch builds to use Ruby 3.1. This means updating the NEXT_RUBY_VERSION variable in CI config to 3.1. Ensure that the variable USE_NEXT_RUBY_VERSION_IN_AUTODEPLOY is set to false in all the mirrors before this is done.

Edited by Balasankar 'Balu' C