Git Product home page Git Product logo

Comments (5)

infused avatar infused commented on August 18, 2024

The only place .get is called in the DBF code is when trying to read a memo
field. I'm guessing you are using a dbf file that should have a memo file,
but the memo file is missing. Could that be the case?

On Sat, Jun 22, 2013 at 8:47 PM, Stephen Silber [email protected]:

I have written a rake task to import from a dbf file into my current rails
application but have run into a strange bug.

desc "Import brothers"
task :import_brothers => :environment do
bro_db = DBF::Table.new("bro.dbf")
bros = bro_db.find(:all)

bros.each do |brother|
    b = Brother.new
        b.last_name             = brother["L_NAME"] unless brother["L_NAME"].nil?

I receive the error undefined method `get' for nil:NilClass

The strange part is that I can p bros.first and see that there is a column
named L_NAME and I created a fresh rails project with the same gemfile and
same schema for "brother" and it ran fine. Any ideas?


Reply to this email directly or view it on GitHubhttps://github.com//issues/54
.

from dbf.

stephensilber avatar stephensilber commented on August 18, 2024

That sounds likely, could you possibly elaborate a little bit on how I can fix this situation? I don't regularly work with DBF but it's the only format my database is available in

from dbf.

infused avatar infused commented on August 18, 2024

The memo file should be the same name as the dbf file, but with an
extension of .dbt or .fpt instead of .dbf. Make sure the file is in the
same directory with the .dbf file.

On Sat, Jun 22, 2013 at 10:50 PM, Stephen Silber
[email protected]:

That sounds likely, could you possibly elaborate a little bit on how I can
fix this situation? I don't regularly work with DBF but it's the only
format my database is available in


Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-19869517
.

from dbf.

infused avatar infused commented on August 18, 2024

I just released v2.0.4 which forces memo fields to return nil if the memo file is missing.

from dbf.

stephensilber avatar stephensilber commented on August 18, 2024

Very helpful, thank you so much!

from dbf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.