midwire / free_zipcode_data

Free US and world-wide postal codes in SQLite and CSV format
MIT License
86 stars 24 forks source link

No such file or directory @ rb_sysopen - country_lookup_table.yml #12

Closed srghma closed 5 years ago

srghma commented 6 years ago

Actual Behavior

 ~/projects  docker-ruby bash
root@78ad4e8e1709:/usr/src/app# gem install free_zipcode_data
Fetching: colored-1.2.gem (100%)
Successfully installed colored-1.2
Fetching: kiba-2.0.0.gem (100%)
Successfully installed kiba-2.0.0
Fetching: ruby-progressbar-1.9.0.gem (100%)
Successfully installed ruby-progressbar-1.9.0
Fetching: rubyzip-1.2.1.gem (100%)
Successfully installed rubyzip-1.2.1
Fetching: sqlite3-1.3.13.gem (100%)
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.13
Fetching: trollop-2.1.2.gem (100%)
Successfully installed trollop-2.1.2
Fetching: free_zipcode_data-1.0.1.gem (100%)
Successfully installed free_zipcode_data-1.0.1
7 gems installed
root@78ad4e8e1709:/usr/src/app# free_zipcode_data --work-dir /tmp/geodata --generate-files --verbose
Starting FreeZipcodeData v1.0.1...
Downloading: allCountries.zip from GeoNames...
Extracting: allCountries.zip...
Preparing: /tmp/geodata/allCountries.txt.csv for processing...
Processing 1264588 zipcodes in '/tmp/geodata/allCountries.txt.csv'...
Initializing country table: 'countries'...
Initializing state table: 'states'...                                                                                   |  ETA: ??:??:??
Initializing county table: 'counties'...                                                                                |  ETA: ??:??:??
Initializing zipcode table: 'zipcodes'...                                                                               |  ETA: ??:??:??
Processing '/tmp/geodata/allCountries.txt.csv' data, please be patient...                                               |  ETA: ??:??:??
Traceback (most recent call last):                                                                                      |  ETA: ??:??:??
        22: from /usr/local/bundle/bin/free_zipcode_data:23:in `<main>'
        21: from /usr/local/bundle/bin/free_zipcode_data:23:in `load'
        20: from /usr/local/bundle/gems/free_zipcode_data-1.0.1/bin/free_zipcode_data:9:in `<top (required)>'
        19: from /usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/free_zipcode_data/runner.rb:42:in `start'
        18: from /usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/free_zipcode_data/runner.rb:101:in `extract_transform_load'
        17: from /usr/local/bundle/gems/kiba-2.0.0/lib/kiba.rb:17:in `run'
        16: from /usr/local/bundle/gems/kiba-2.0.0/lib/kiba/runner.rb:15:in `run'
        15: from /usr/local/bundle/gems/kiba-2.0.0/lib/kiba/runner.rb:41:in `process_rows'
        14: from /usr/local/bundle/gems/kiba-2.0.0/lib/kiba/runner.rb:41:in `each'
        13: from /usr/local/bundle/gems/kiba-2.0.0/lib/kiba/runner.rb:42:in `block in process_rows'
        12: from /usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/etl/csv_source.rb:16:in `each'
        11: from /usr/local/lib/ruby/2.5.0/csv.rb:1289:in `open'
        10: from /usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/etl/csv_source.rb:21:in `block in each'
         9: from /usr/local/lib/ruby/2.5.0/csv.rb:1764:in `each'
         8: from /usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/etl/csv_source.rb:22:in `block (2 levels) in each'
         7: from /usr/local/bundle/gems/kiba-2.0.0/lib/kiba/runner.rb:48:in `block (2 levels) in process_rows'
         6: from /usr/local/bundle/gems/kiba-2.0.0/lib/kiba/runner.rb:48:in `each'
         5: from /usr/local/bundle/gems/kiba-2.0.0/lib/kiba/runner.rb:49:in `block (3 levels) in process_rows'
         4: from /usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/free_zipcode_data/country_table.rb:27:in `write'
         3: from /usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/free_zipcode_data/db_table.rb:27:in `country_lookup_table'
         2: from /usr/local/lib/ruby/2.5.0/psych.rb:497:in `load_file'
         1: from /usr/local/lib/ruby/2.5.0/psych.rb:497:in `open'
/usr/local/lib/ruby/2.5.0/psych.rb:497:in `initialize': No such file or directory @ rb_sysopen - country_lookup_table.yml (Errno::ENOENT)
root@78ad4e8e1709:/usr/src/app#

Steps to reproduce the problem

docker-ruby bash

srghma commented 6 years ago

fixed by cd tmp/geodata && wget github/..../country_lookup_table.yml country_lookup_table.yml

srghma commented 6 years ago

Now I see error

root@507000416d85:/app/tmp/geodata# free_zipcode_data --work-dir . --generate-files --verbose
Starting FreeZipcodeData v1.0.1...
File: ./allCountries.txt.csv already exists, skipping...
Processing 1264588 zipcodes in './allCountries.txt.csv'...
Initializing country table: 'countries'...
Initializing state table: 'states'...                                                                                   |  ETA: ??:??:??
Initializing county table: 'counties'...                                                                                |  ETA: ??:??:??
Initializing zipcode table: 'zipcodes'...                                                                               |  ETA: ??:??:??
Processing './allCountries.txt.csv' data, please be patient...                                                          |  ETA: ??:??:??
Finished generating table data...================================================================================       |  ETA: 00:00:30
Saving database to disk './free_zipcode_data.sqlite3'...
Generating .csv files...
/usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/free_zipcode_data/runner.rb:69:in `datasource_line_count': wrong number of arguments (given 0, expected 1) (ArgumentError)
        from /usr/local/bundle/gems/free_zipcode_data-1.0.1/lib/free_zipcode_data/runner.rb:53:in `start'
        from /usr/local/bundle/gems/free_zipcode_data-1.0.1/bin/free_zipcode_data:9:in `<top (required)>'
        from /usr/local/bundle/bin/free_zipcode_data:23:in `load'
        from /usr/local/bundle/bin/free_zipcode_data:23:in `<main>'
midwire commented 5 years ago

I apologize for my unresponsiveness. I use a forwarding service for certain emails and it has not been forwarding my Github notifications for many months. I just realized this and will now be more responsive as a result. Looking into your PR now.

midwire commented 5 years ago

I believe this issue is now fixed. Please advise if there are related problems.