i think it doesn't recurse since no directories match '*.rb'
(i did not make or implement file globbing logic in unix utilities)
you can also use find:
find . -name '*.rb' | grep utf-8
also, i find it better to focus on getting it done (learning, flexible in approach) as opposed to finding tools that work as you'd expect them to ...
but that's me (and may not be you)
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!