Skip to content

generate-loc-seeddata execution fails #3

Open

Description

@behas

maphub@samos:~/maphub-seeddata/scripts$ ruby generate-loc-seeddata.rb -i ../../data/maps/ -m ../../data/metadata/ -n 5
Finding all the map files...
Finding all the metadata files ...
Creating output YAML File
generate-loc-seeddata.rb:177:in <main>': undefined methodparent' for nil:NilClass (NoMethodError)

Activity

  1. shionguha commented on Apr 11, 2012

    @shionguha
    Member

    I tested my code on both ruby versions and put up the question on stackoverflow because I don't know what else can be going wrong. Somebody suggested a possible fix. Here is the link: http://stackoverflow.com/questions/10093440/ruby-script-running-on-local-machine-but-not-running-on-server-version-issues#comment12944991_10093440

    What do you think?

  2. behas commented on Apr 11, 2012

    @behas
    MemberAuthor

    My guess is that on of your XPATH expressions evaluate into NIL (= don't match) and you execute some method (e.g, ".text") on NIL.

    Bernhard


    Bernhard Haslhofer
    Postdoc Associate
    Cornell Information Science
    301 College Ave.
    Ithaca, NY 14850
    WWW: http://www.cs.cornell.edu/~bh392/
    Skype: bernhard.haslhofer

    On Wednesday, April 11, 2012 at 1:14 PM, Shion wrote:

    I tested my code on both ruby versions and put up the question on stackoverflow because I don't know what else can be going wrong. Somebody suggested a possible fix. Here is the link: http://stackoverflow.com/questions/10093440/ruby-script-running-on-local-machine-but-not-running-on-server-version-issues#comment12944991_10093440

    What do you think?


    Reply to this email directly or view it on GitHub:
    https://github.com/maphub/maphub-seeddata/issues/3#issuecomment-5073824

  3. shionguha commented on Apr 13, 2012

    @shionguha
    Member

    I just did the following to debug:

    Copied my test maps directory, test metadata directory and script to the server to test the failure of the script on the server. Got the same error i.e.

    generate-loc-seeddata.rb:177:in <main>': undefined methodparent' for nil:NilClass (NoMethodError)

    Since the script with the exact same files and metadata work on my machine, they should also work on the server. However, they don't.

    Line 177:

    record_node = identifier_nodes.first.parent.parent #This is where I am trying to get the entire metadata record for a given identifier match
    

    Since the 'parent' method cannot be found, I am a little perplexed because it comes from REXML which I understand is part of the standard Ruby library. This needs more investigation.

  4. behas commented on Apr 13, 2012

    @behas
    MemberAuthor

    I am pretty sure that you a have a typical NULL Pointer exception, which occur when you try to execute a method (e.g., parent) on a NIL object. Maybe one of your XPATH expressions result in no match (= NIL), but you still call .parent….

    b


    Bernhard Haslhofer
    Postdoc Associate
    Cornell Information Science
    301 College Ave.
    Ithaca, NY 14850
    WWW: http://www.cs.cornell.edu/~bh392/
    Skype: bernhard.haslhofer

    On Friday, April 13, 2012 at 11:56 AM, Shion wrote:

    I just did the following to debug:

    Copied my test maps directory, test metadata directory and script to the server to test the failure of the script on the server. Got the same error i.e.

    generate-loc-seeddata.rb:177:in <main>': undefined methodparent' for nil:NilClass (NoMethodError)

    Since the script with the exact same files and metadata work on my machine, they should also work on the server. However, they don't.

    Line 177: record_node = identifier_nodes.first.parent.parent #This is where I am trying to get the entire metadata record for a given identifier match

    Since the 'parent' method cannot be found, I am a little perplexed because it comes from REXML which I understand is part of the standard Ruby library. This needs more investigation.


    Reply to this email directly or view it on GitHub:
    https://github.com/maphub/maphub-seeddata/issues/3#issuecomment-5117614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions