alexreisner / geocoder

Complete Ruby geocoding solution.
http://www.rubygeocoder.com
MIT License
6.33k stars 1.19k forks source link

MaxMind Local not work #1613

Open amowu opened 1 year ago

amowu commented 1 year ago

BEFORE POSTING AN ISSUE, PLEASE MAKE SURE THE PROBLEM IS NOT ADDRESSED IN THE README!

Expected behavior

I an follow https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md#maxmind-local-maxmind_local---experimental steps

When I run:

# generate migration to create tables
rails generate geocoder:maxmind:geolite_city

I got correct DB tables.

And When I run:

# download, unpack, and import data
rake geocoder:maxmind:geolite:load PACKAGE=city LICENSE_KEY=<KEY>

It should be work.

Actual behavior

But it got:

SocketError: Failed to open TCP connection to geolite.maxmind.com:80 (getaddrinfo: nodename nor servname provided, or not known)

Caused by:
SocketError: getaddrinfo: nodename nor servname provided, or not known

Tasks: TOP => geocoder:maxmind:geolite:load => geocoder:maxmind:geolite:download
(See full trace by running task with --trace)

Steps to reproduce

https://github.com/alexreisner/geocoder/blob/master/README_API_GUIDE.md#maxmind-local-maxmind_local---experimental steps

Environment info

RongRongTeng commented 1 year ago

Is this problem solve after this PR ? 🙏🏻

amowu commented 1 year ago

Is this problem solve after this PR ? 🙏🏻

@RongRongTeng you are right.

1600 merge only the latest version of the master branch has the LICENSE_KEY.

The current version 1.8.1 does not have the LICENSE_KEY option.

But even if I change it to the master version, it still doesn't work.

- gem 'geocoder', '1.8.1'
+ gem 'geocoder', github: 'alexreisner/geocoder', ref: '3f9e9'

237614869-f75f7f91-a96a-4bf7-9b24-b75b25c63f84

The reason is that at line 33, it calls archive_url_path:

https://github.com/alexreisner/geocoder/blob/ee5cfe67c6540c9093114ee22f715f8df72aa9c4/lib/maxmind_database.rb#L33

But in #1600, this method has already been renamed:

https://github.com/alexreisner/geocoder/pull/1600/files#diff-e70a403b9d56449ef46d7338bfa456ed872a01a51a8f5ac7a8a058137ece6eaaL97-R97

cc @coder2000

coder2000 commented 1 year ago

I thought I had accounted for all instances of the method calls. I will have a fix available for testing tomorrow if someone else doesn't do it first.

richjdsmith commented 11 months ago

@coder2000 did you end up building a fix?

coder2000 commented 11 months ago

No. If I remember they changed their download URIs. It shouldn't be too hard to find the new ones and add them.