diff --git a/README.md b/README.md index bd13575b74fac4256851a8c1eb2f7aaa0990c4a2..d17e855e2b979e4fbaf3a97a6325f000dbe6cbe9 100644 --- a/README.md +++ b/README.md @@ -735,7 +735,7 @@ You must add either the *[hive_geoip2](https://rubygems.org/gems/hive_geoip2)* g Geocoder.configure( ip_lookup: :geoip2, geoip2: { - maxminddb_gem: 'hive_geoip2', + lib: 'hive_geoip2', file: File.join('folder', 'GeoLite2-City.mmdb') } ) diff --git a/lib/geocoder/lookups/geoip2.rb b/lib/geocoder/lookups/geoip2.rb index acfdfe40c2c4ef01eb97400b2ce556d871925405..894dabccf307394a23d3f45fe6d5e5dc5d942383 100644 --- a/lib/geocoder/lookups/geoip2.rb +++ b/lib/geocoder/lookups/geoip2.rb @@ -7,7 +7,7 @@ module Geocoder def initialize unless configuration[:file].nil? begin - @gem_name = configuration[:maxminddb_gem] || 'maxminddb' + @gem_name = configuration[:lib] || 'maxminddb' require @gem_name rescue LoadError raise "Could not load Maxmind DB dependency. To use the GeoIP2 lookup you must add the #{@gem_name} gem to your Gemfile or have it installed in your system."