used gem geoip_rails for the freegeoip.net API