Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate-loc-seeddata execution fails #3

Open
behas opened this issue Apr 11, 2012 · 4 comments
Open

generate-loc-seeddata execution fails #3

behas opened this issue Apr 11, 2012 · 4 comments
Assignees

Comments

@behas
Copy link
Member

behas commented Apr 11, 2012

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)

@ghost ghost assigned shionguha Apr 11, 2012
@shionguha
Copy link
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?

@behas
Copy link
Member Author

behas commented Apr 11, 2012

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

@shionguha
Copy link
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.

@behas
Copy link
Member Author

behas commented Apr 13, 2012

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants