Ruby-freegeoip is a project mainly written in Ruby, it's free.
Ruby class to access geographic location information about an IP address using freegeoip.net api.
A ruby script to get geographic location information about an IP address. Uses the http://freegeoip.net/ API.