You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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.
Activity
shionguha commentedon Apr 11, 2012
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 commentedon 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:
shionguha commentedon Apr 13, 2012
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:
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 commentedon 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: