I'm using GeoCoder as part of Ahoy and its README recommends Geolite2 for a quicker local search which I found totally fine for me purposes. There's even a debian and arch packages for geolite2.
+1, I also went this way for one project, works well.
here's my geocoder.rb setup
geocoder.rb
# config/initializers/geocoder.rb def valid_geo_file file_path = "#{Rails.root}/GeoLite2-City.mmdb" return file_path if File.exist?(file_path) end Geocoder.configure( lookup: :mapbox, ip_lookup: :geoip2, api_key: Rails.application.credentials.dig(:mapbox, :token), geoip2: { file: valid_geo_file } )
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm using GeoCoder as part of Ahoy and its README recommends Geolite2 for a quicker local search which I found totally fine for me purposes. There's even a debian and arch packages for geolite2.
+1, I also went this way for one project, works well.
here's my
geocoder.rb
setup