Bump Ruby in builder images to 3.1

All of GitLab is switching to Ruby 3.1. Let's bump the Ruby used in our builder images also to it.

Note: This is neither a part of &11659 (closed) nor a blocker for it