I've developed a small tool[1] that has helped me for the same problem, but in Python. Basically just uses simple parsers to attempt to find a definition wherever is sensible. Adding a Ruby module should not be too difficult, but it would probably be trickier than Python to get some good enough results
Because it's an unsolvable problem without static type annotations and as far as I'm aware Ruby doesn't have a good solution for those yet (or if they do nobody uses it).
I've developed a small tool[1] that has helped me for the same problem, but in Python. Basically just uses simple parsers to attempt to find a definition wherever is sensible. Adding a Ruby module should not be too difficult, but it would probably be trickier than Python to get some good enough results
[1] https://github.com/federicotdn/irk