Ruby, XmlSimple and unicode works on OSX but not Linux

I have a simple script, which uses xml-simple to load and parse a file stored in Unicode UTF-16.\[code\]require 'rubygems'require 'xmlsimple'doc = File.open('foo2.xml').readputs docconfig = XmlSimple.xml_in('foo2.xml')print "All done\n"\[/code\]On OSX the command runs just fine:\[code\]$ ruby foo.rb ??<config> <description>Launchpad 2</description> <type>test</type> <latestStatus>CF</latestStatus> <disable></disable></config>All done\[/code\]On Linux I get an error:\[code\]$ ruby foo.rb ??<config a="b"> <description>Launchpad 2</description> <type>test</type> <latestStatus>CF</latestStatus> <disable></disable></config>/usr/lib/ruby/gems/1.8/gems/xml-simple-1.1.1/lib/xmlsimple.rb:714:in `get_attributes': undefined method `attributes' for nil:NilClass (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/xml-simple-1.1.1/lib/xmlsimple.rb:461:in `collapse' from /usr/lib/ruby/gems/1.8/gems/xml-simple-1.1.1/lib/xmlsimple.rb:194:in `xml_in' from /usr/lib/ruby/gems/1.8/gems/xml-simple-1.1.1/lib/xmlsimple.rb:203:in `xml_in' from foo.rb:10\[/code\]In both cases the file read is reading simple bytes as shown by the ?? for the utf16 marker, but for some reason the same version of xml-simple can parse the file on OSX but not on Linux.I don't know if the problem is a result of the OS, missing gems, a missing environment variable, or something I am doing.Does anyone have any suggestions?I'm using ruby 1.8.7 on both machines, and xml-simple-1.1.1. This is the configuration file for a ToolTwist Controller installation.
 
Back
Top