ruby: fix ruby 3.1 warnings