From: Aaron Patterson Date: 2009-11-13T01:34:35+09:00 Subject: Re: Simple problem using Nokogiri xml eaderr On Thu, Nov 12, 2009 at 03:01:35PM +0900, Philip Stephens wrote: > Hi. I am a newbie when it comes to using Nokogiri reader to parse an > xml file. Here is the xml file I want to parse and sample code: > > > > > > > ----------------------------------------------------------------- > require 'rubygems' > require 'nokogiri' > > io = File.open('test.xml', 'r') > reader = Nokogiri::XML::Reader(io) > > reader.each do |node| > > # node is an instance of Nokogiri::XML::Readerruby > puts node.name > > end > > The following is the error message I get: > > pcs$ ruby1.9 TestNok.rb > WARNING: Nokogiri was built against LibXML version 2.6.32, but has > dynamically loaded 2.7.5 > /usr/lib/ruby/1.9.0/nokogiri/xml/reader.rb:60:in `read': ParsePI: PI xm > never end ... (Nokogiri::XML::SyntaxError) > from /usr/lib/ruby/1.9.0/nokogiri/xml/reader.rb:60:in `each' > from TestNok.rb:7:in `
' > : [BUG] Segmentation fault > ruby 1.9.0 (2008-10-04 revision 19669) [i486-linux] ^^^^^ Looks like you're using 1.9.0 There are bugs in 1.9.0 which cause nokogiri to crash. I suggest you upgrade to the latest 1.9.1 release and reinstall nokogiri. -- Aaron Patterson http://tenderlovemaking.com/