【发布时间】:2014-09-12 13:48:18
【问题描述】:
我有来自 MaxMind 的 GeoIP.dat(国家)和 GeoLiteCity.dat(城市)数据。国家数据在我当地的 Rails 开发中运行良好,但是当我尝试查找城市数据时,它返回 null。
但是,当我部署到 Heroku 时,城市数据确实返回了正确的值。知道为什么国家/地区数据在本地发展中起作用而城市数据不起作用吗?
在 Heroku 中工作,而不是在本地:
geoip = GeoIP.new('geoip/GeoLiteCity.dat').city(request.remote_ip)
两者都适用:
geoip = GeoIP.new('geoip/GeoIP.dat').country(request.remote_ip)
【问题讨论】:
标签: ruby-on-rails heroku geoip