Import of the FIAS base in Postgresql



  • I'm writing microservices to work with the figs, problems first stepped up, hooking up the haem. https://github.com/evilmartians/fias He tried to import from DBF in Postgresql, using a roll of the gem described. In the end, I get a stacktreace like this:

    vagrant@fsc-dev:~/fiasco/tmp/fias$ bundle exec rake fias:create_tables fias:import
    DATABASE_URL=postgres://localhost/fiasco_db FIAS_PATH=$(pwd) 
    (in /home/vagrant/fiasco)
    rake aborted!
    DBF::Column::NameError: column name cannot be empty
    /var/lib/gems/2.2.0/gems/dbf-3.0.3/lib/dbf/column.rb:152:in `validate_name'
    /var/lib/gems/2.2.0/gems/dbf-3.0.3/lib/dbf/column.rb:41:in `initialize'
    /var/lib/gems/2.2.0/gems/dbf-3.0.3/lib/dbf/table.rb:216:in `new'
    /var/lib/gems/2.2.0/gems/dbf-3.0.3/lib/dbf/table.rb:216:in `build_columns'
    /var/lib/gems/2.2.0/gems/dbf-3.0.3/lib/dbf/table.rb:198:in `columns'
    /var/lib/gems/2.2.0/gems/fias-1.0.1/lib/fias/import/tables.rb:40:in `columns_for'
    /var/lib/gems/2.2.0/gems/fias-1.0.1/lib/fias/import/tables.rb:32:in `create_table'
    /var/lib/gems/2.2.0/gems/fias-1.0.1/lib/fias/import/tables.rb:15:in `block in create'
    /var/lib/gems/2.2.0/gems/fias-1.0.1/lib/fias/import/tables.rb:13:in `each'
    /var/lib/gems/2.2.0/gems/fias-1.0.1/lib/fias/import/tables.rb:13:in `create'
    /var/lib/gems/2.2.0/gems/fias-1.0.1/tasks/db.rake:9:in `block (3 levels) in <top (required)>'
    /var/lib/gems/2.2.0/gems/fias-1.0.1/tasks/db.rake:50:in `within_connection'
    /var/lib/gems/2.2.0/gems/fias-1.0.1/tasks/db.rake:8:in `block (2 levels) in <top (required)>'
    Tasks: TOP => fias:create_tables
    

    It's a little bit of time for a sin to hide: I don't want to know everything about zero, I've been looking for a solution, and maybe it's just that, and I don't catch anything clearly, and I haven't been thinking about it for a long time.



  • Probably some dbf doesn't have a name in the field.
    Show the result:

    bundle exec rake fias:create_tables fias:import DATABASE_URL=postgres://localhost/fiasco_db --trace
    

    Delete the old archive.

    rm -r tmp/fias tmp/fias/fias_dbf.rar
    

    Roll a new one. He's quite updated.

    bundle exec rake fias:download | xargs wget
    

    I've got a full implementation process. введите сюда описание изображения




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2