【问题标题】:How to import MaxMind local data, CSV files into redis in Rails?Rails中如何将MaxMind本地数据、CSV文件导入redis?
【发布时间】:2017-12-25 09:01:26
【问题描述】:
我需要将 Maxmind 提供的 CSV 文件导入到 Ruby on Rails 应用程序中的 Redis。
在这个link 中,他们为 SQL 数据库提供了方法,但没有为 NoSQL 数据库提供方法。
【问题讨论】:
标签:
ruby-on-rails
csv
redis
geoip
maxmind
【解决方案2】:
我用过这个宝石:
https://github.com/zabolotnov87/geoip_redis
实现起来很容易。
我找到的其他解决方案是:
https://redislabs.com/ebook/part-2-core-concepts/chapter-5-using-redis-for-application-support/5-3-ip-to-city-and-country-lookup/5-3-1-loading-the-location-tables/
https://redislabs.com/ebook/part-2-core-concepts/chapter-5-using-redis-for-application-support/5-3-ip-to-city-and-country-lookup/5-3-2-looking-up-cities/
他们已经正确地描述了它用于加载 csv 文件和查找城市,但代码是在 python 中。