【发布时间】:2014-12-12 05:24:53
【问题描述】:
if Rails.env.development?
@current_location_geo = Geocoder.search(request.remote_ip).first
else
@current_location_geo = request.location
end
if !@current_location_geo.nil? && @current_location_geo.ip == "127.0.0.1"
@departure_currency_code= "AUD"
@departure_currency_name= ["Australian Dollar(AUD $)","AUD"]
else
@country = Country.new(request.location.data["country_code"].to_s)
@country_code = @country.currency.code
end
end
我得到 request.location nil。我尝试在配置中添加超时,但对我没有帮助。
生产模式中的错误 “Geocoding API 的响应不是有效的 JSON。”
当我追踪它时,我得到 request.location 为零。
我的地理编码器版本是 (1.2.6)。
【问题讨论】:
标签: ruby-on-rails ruby geocode