Skip to content
Snippets Groups Projects
Commit 5eef05c5 authored by joshlarsen's avatar joshlarsen
Browse files

Update README.md

Updated MaxMind Local setup instructions
parent 2e98af6c
No related branches found
No related tags found
No related merge requests found
...@@ -603,6 +603,10 @@ This lookup provides methods for geocoding IP addresses without making a call to ...@@ -603,6 +603,10 @@ This lookup provides methods for geocoding IP addresses without making a call to
* **Limitations**: ? * **Limitations**: ?
* **Notes**: There are two supported formats for MaxMind local data: binary file, and CSV file imported into an SQL database. **You must download a database from MaxMind and set either the `:file` or `:package` configuration option for local lookups to work.** * **Notes**: There are two supported formats for MaxMind local data: binary file, and CSV file imported into an SQL database. **You must download a database from MaxMind and set either the `:file` or `:package` configuration option for local lookups to work.**
**To create a Rails initializer** with an example configuration:
rails generate geocoder:config
**To use a binary file** you must add the *geoip* (or *jgeoip* for JRuby) gem to your Gemfile or have it installed in your system, and specify the path of the MaxMind database in your configuration. For example: **To use a binary file** you must add the *geoip* (or *jgeoip* for JRuby) gem to your Gemfile or have it installed in your system, and specify the path of the MaxMind database in your configuration. For example:
Geocoder.configure(ip_lookup: :maxmind_local, maxmind_local: {file: File.join('folder', 'GeoLiteCity.dat')}) Geocoder.configure(ip_lookup: :maxmind_local, maxmind_local: {file: File.join('folder', 'GeoLiteCity.dat')})
...@@ -613,12 +617,12 @@ This lookup provides methods for geocoding IP addresses without making a call to ...@@ -613,12 +617,12 @@ This lookup provides methods for geocoding IP addresses without making a call to
You can generate ActiveRecord migrations and download and import data via provided rake tasks: You can generate ActiveRecord migrations and download and import data via provided rake tasks:
rails generate geocoder:maxmind:geolite_city rails generate geocoder:maxmind:geolite PACKAGE=city
rake geocoder:maxmind:geolite_city:download rake geocoder:maxmind:geolite:download PACKAGE=city
rake geocoder:maxmind:geolite_city:extract rake geocoder:maxmind:geolite:extract PACKAGE=city
rake geocoder:maxmind:geolite_city:insert rake geocoder:maxmind:geolite:insert PACKAGE=city
rake geocoder:maxmind:geolite_city:load # runs the above three in sequence rake geocoder:maxmind:geolite:load PACKAGE=city # runs the above three in sequence
You can replace `city` with `country` in any of the above tasks, generators, and configurations. You can replace `city` with `country` in any of the above tasks, generators, and configurations.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment