This problem is already solved in Ruby; take an eye to the "did_you_mean" gem: github.com/yuki24/did_you_mean
It was created as a separate gem, but it's now part of ruby core. Any ruby syntax error comes now with a nice "did you mean..." with useful suggestions.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.