A
Alder Green
I've been using hpricot 0.4 in Windows XP with no problems. Recently I
migrated some scripts to Ubuntu Dapper 6.06, running Ruby 1.8.4, and
encountered a weird fatal problems with hpricot 0.4:
irb(main):001:0> require 'hpricot'
=> true
irb(main):002:0> Hpricot("<p>A simple <b>test</b> string.</p>")
NoMethodError: private method `scan' called for Hpricot:Module
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:19:in
`make'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:11:in
`parse'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:4:in
`Hpricot'
from (irb):2
That error causes all tests in test_parser.rb to fail upon startup.
Trying to make Hpricot.scan public at runtime pruduced another error:
irb(main):002:0> class << Hpricot; public :scan; end
=> #<Class:Hpricot>
irb(main):003:0> Hpricot("<p>A simple <b>test</b> string.</p>")
TypeError: $_ value need to be String (nil given)
from (irb):2:in `scan'
from (irb):2:in `scan'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:19:in
`make'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:11:in
`parse'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:4:in
`Hpricot'
from (irb):3
Any help with this would be appreciated.
migrated some scripts to Ubuntu Dapper 6.06, running Ruby 1.8.4, and
encountered a weird fatal problems with hpricot 0.4:
irb(main):001:0> require 'hpricot'
=> true
irb(main):002:0> Hpricot("<p>A simple <b>test</b> string.</p>")
NoMethodError: private method `scan' called for Hpricot:Module
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:19:in
`make'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:11:in
`parse'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:4:in
`Hpricot'
from (irb):2
That error causes all tests in test_parser.rb to fail upon startup.
Trying to make Hpricot.scan public at runtime pruduced another error:
irb(main):002:0> class << Hpricot; public :scan; end
=> #<Class:Hpricot>
irb(main):003:0> Hpricot("<p>A simple <b>test</b> string.</p>")
TypeError: $_ value need to be String (nil given)
from (irb):2:in `scan'
from (irb):2:in `scan'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:19:in
`make'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:11:in
`parse'
from /usr/lib/ruby/gems/1.8/gems/hpricot-0.4/lib/hpricot/parse.rb:4:in
`Hpricot'
from (irb):3
Any help with this would be appreciated.