[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Fatal errors in hpricot 0.4

Alder Green

9/13/2006 9:59:00 AM

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.

--
-Alder

3 Answers

vendredi5h@gmail.com

9/19/2006 1:35:00 AM

0

Hello all,

After changing my OS from Mandriva to Ubuntu Dapper 6.06, I've got this
same error message when running a ruby script that was working fine on
my Mandriva setup.

Anybody could give me/us some hint ?

Thanks

Yannick

PS. Alder, does your script use Mechanize gem?



Alder Green a écrit :
> 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.


Alder Green

9/19/2006 9:07:00 AM

0

On 9/19/06, vendredi5h@gmail.com <vendredi5h@gmail.com> wrote:
> Hello all,
>
> After changing my OS from Mandriva to Ubuntu Dapper 6.06, I've got this
> same error message when running a ruby script that was working fine on
> my Mandriva setup.
>
> Anybody could give me/us some hint ?
>
> Thanks
>
> Yannick
>
> PS. Alder, does your script use Mechanize gem?

No, my script only uses Hpricot, and the failure is definitely in the
Hpricot part.

But if you're using Mechanize >= 0.6.0, then you're depending on
Hpricot[1]. That would probably be the cause of the identical error
you're witnessing.

My best guess so far is that something's wrong with the compilation of
the gem on Dapper 6.0.6. My own system is the AMD64 release. What's
yours?

I guess the next logical step - assuming we get no answer here - is to
file a bug report on the Hpricot trac.

--
-Alder

[1] http://rubyforge.org/forum/forum.php?for...

vendredi5h@gmail.com

9/19/2006 10:13:00 PM

0

Hello Alder,

Not surprising my script was working fine before my OS move since I'm
pretty sure Mechanize version I had on Mandriva did not depend on
Hpricot.

Anyway that's not important. The bug has already been reported:
http://code.whytheluckystiff.net/hprico... I'll follow this
closely...

Yannick