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

undefined method `each' for "":String in ruby 1.9.3 #47

Closed
railsfactory-dhamodharan opened this issue Jun 15, 2012 · 4 comments
Closed

Comments

@railsfactory-dhamodharan

roxml (3.3.1) lib/roxml/xml/references.rb:179:in block in update_xml' roxml (3.3.1) lib/roxml/xml/references.rb:173:intap'
roxml (3.3.1) lib/roxml/xml/references.rb:173:in update_xml' roxml (3.3.1) lib/roxml.rb:42:inblock (2 levels) in to_xml'
roxml (3.3.1) lib/roxml.rb:39:in each' roxml (3.3.1) lib/roxml.rb:39:inblock in to_xml'
roxml (3.3.1) lib/roxml.rb:35:in tap' roxml (3.3.1) lib/roxml.rb:35:into_xml'
roxml (3.3.1) lib/roxml/xml/references.rb:295:in block (2 levels) in update_xml' roxml (3.3.1) lib/roxml/xml/references.rb:294:ineach'
roxml (3.3.1) lib/roxml/xml/references.rb:294:in block in update_xml' roxml (3.3.1) lib/roxml/xml/references.rb:291:intap'
roxml (3.3.1) lib/roxml/xml/references.rb:291:in update_xml' roxml (3.3.1) lib/roxml.rb:42:inblock (2 levels) in to_xml'
roxml (3.3.1) lib/roxml.rb:39:in each' roxml (3.3.1) lib/roxml.rb:39:inblock in to_xml'
roxml (3.3.1) lib/roxml.rb:35:in tap' roxml (3.3.1) lib/roxml.rb:35:into_xml'

Need to upgrade as per latest ruby.

@Empact
Copy link
Owner

Empact commented Jun 15, 2012

So the tests run green - it seems you have an inconsistency between your declarations (which indicate that this attribute should have several values) and your data, which resolves down to a single string. If you provide your declarations and your source data, I can perhaps add this case to the test suite and handle it better.

@railsfactory-dhamodharan
Copy link
Author

Parameters passed to update_xml(xml, value) method as following:

Xml  = #<Nokogiri::XML::Element:0x69ec4dc name="SalesRights">02#<Nokogiri::XML::Element:0x69ec4dc name="SalesRights" children=[#<Nokogiri::XML::Element:0x69ebd8e name="SalesRightsType" children=[#<Nokogiri::XML::Text:0x69eb690 "02">]>]>

value = ""

@Empact
Copy link
Owner

Empact commented Jun 15, 2012

Can you be more clear about how you're using the library? Are you calling #update_xml directly? If so I'd like to understand why, it's not intended to be called directly.

Again, it seems there's an inconsistency between your declarations and the value you're supplying for the attribute. You're giving an empty string for the value, but the reference that you've declared is an array reference.

@railsfactory-dhamodharan
Copy link
Author

I apologize for wrong attribute, I have invoked from my customized Onix gem problem from my side.

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