Given what you're looking to do: Geocoding gem: http://railscasts.com/episodes/273-geocoder Devise gem: http://railscasts.com/episodes/209-devise-revised
The former uses the google maps api to handle geocoding but you could use it as well to figure out the distance between two points. You could also use the great circle formula yourself if you know the lat and long of both points (http://en.wikipedia.org/wiki/Great-circle_distance).
The latter is one of his pro episodes but if you don't mind watching semi-dated material and picking up the rest from docs you could watch the original episode.
I find the railscasts to be extremely helpful when it comes to understanding both what's available to the rails community (lots of gem coverage) and unique ways to deal with common problems.