Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > problems with error output interpretation

Reply
Thread Tools

problems with error output interpretation

 
 
Tom Cloyd
Guest
Posts: n/a
 
      05-19-2008
I hope this is an OK place to post this. I've been able to find another
more promising place.

I'm running an extremely simple program, trying to start using the
Hpricot gem. I don't understand two things with some error output I'm
getting. Here's the program (obviously only a fragment at this time, but
that's 'cause I get in trouble easily):

%w(rubygems logger hpricot ruby-debug).each{|lib| require lib }
doc = open("index.html") { |f| Hpricot(f) }
(doc/"div.page-content-div").inner_html

Here's the console I'm seeing:

$ ruby --debug content_capture.rb
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
- no such file to load -- hpricot
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
- no such file to load -- encoding/character/utf-8
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:34
- no such file to load -- encoding/character/utf-8
/var/lib/gems/1.8/gems/hpricot-0.6/lib/hpricot/builder.rb:11: warning:
`&' interpreted as argument prefix
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
- no such file to load -- ruby-debug
$

First of all, there's nothing in this output which looks like a usable
(by me) trace - the first thing I want to know is WHERE in my program is
the error occurring. There aren't exactly many possibilities, but I'm
still not understanding why there isn't a traceback to the point of
origin of the problem in my tiny program. Makes no sense to me. I'm left
guessing. Am I missing something?

Secondly, I don't see what the problem is. The file I'm trying to open
is assuredly there, and where I'm saying it is. Is this all errors from
hpricot?

Any help would be much appreciated. I'm beached at this point.

t.

--



 
Reply With Quote
 
 
 
 
yermej
Guest
Posts: n/a
 
      05-19-2008
On May 19, 5:28 am, Tom Cloyd <(E-Mail Removed)> wrote:
> I hope this is an OK place to post this. I've been able to find another
> more promising place.
>
> I'm running an extremely simple program, trying to start using the
> Hpricot gem. I don't understand two things with some error output I'm
> getting. Here's the program (obviously only a fragment at this time, but
> that's 'cause I get in trouble easily):
>
> %w(rubygems logger hpricot ruby-debug).each{|lib| require lib }
> doc = open("index.html") { |f| Hpricot(f) }
> (doc/"div.page-content-div").inner_html
>
> Here's the console I'm seeing:
>
> $ ruby --debug content_capture.rb
> Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
> - no such file to load -- hpricot
> Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
> - no such file to load -- encoding/character/utf-8
> Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:34
> - no such file to load -- encoding/character/utf-8
> /var/lib/gems/1.8/gems/hpricot-0.6/lib/hpricot/builder.rb:11: warning:
> `&' interpreted as argument prefix
> Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
> - no such file to load -- ruby-debug
> $
>
> First of all, there's nothing in this output which looks like a usable
> (by me) trace - the first thing I want to know is WHERE in my program is
> the error occurring. There aren't exactly many possibilities, but I'm
> still not understanding why there isn't a traceback to the point of
> origin of the problem in my tiny program. Makes no sense to me. I'm left
> guessing. Am I missing something?
>
> Secondly, I don't see what the problem is. The file I'm trying to open
> is assuredly there, and where I'm saying it is. Is this all errors from
> hpricot?
>
> Any help would be much appreciated. I'm beached at this point.
>
> t.
>
> --


Try running it without the --debug argument and see what happens. I'm
sure somebody else can explain why, but the LoadError messages are
common in debug output when using require. (Maybe it has something to
do with gems?) Those errors don't have useful (to you) stack traces.

Anyway, when I run your example with debug, I get the errors you
posted followed by an error stating that 'index.html' is not found
(because I didn't create one). So, your script is working; you're just
getting confused by other libraries' debug output.
 
Reply With Quote
 
 
 
 
Tom Cloyd
Guest
Posts: n/a
 
      05-20-2008
yermej wrote:
> On May 19, 5:28 am, Tom Cloyd <(E-Mail Removed)> wrote:
>
>> I hope this is an OK place to post this. I've been able to find another
>> more promising place.
>>
>> I'm running an extremely simple program, trying to start using the
>> Hpricot gem. I don't understand two things with some error output I'm
>> getting. Here's the program (obviously only a fragment at this time, but
>> that's 'cause I get in trouble easily):
>>
>> %w(rubygems logger hpricot ruby-debug).each{|lib| require lib }
>> doc = open("index.html") { |f| Hpricot(f) }
>> (doc/"div.page-content-div").inner_html
>>
>> Here's the console I'm seeing:
>>
>> $ ruby --debug content_capture.rb
>> Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
>> - no such file to load -- hpricot
>> Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
>> - no such file to load -- encoding/character/utf-8
>> Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:34
>> - no such file to load -- encoding/character/utf-8
>> /var/lib/gems/1.8/gems/hpricot-0.6/lib/hpricot/builder.rb:11: warning:
>> `&' interpreted as argument prefix
>> Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27
>> - no such file to load -- ruby-debug
>> $
>>
>> First of all, there's nothing in this output which looks like a usable
>> (by me) trace - the first thing I want to know is WHERE in my program is
>> the error occurring. There aren't exactly many possibilities, but I'm
>> still not understanding why there isn't a traceback to the point of
>> origin of the problem in my tiny program. Makes no sense to me. I'm left
>> guessing. Am I missing something?
>>
>> Secondly, I don't see what the problem is. The file I'm trying to open
>> is assuredly there, and where I'm saying it is. Is this all errors from
>> hpricot?
>>
>> Any help would be much appreciated. I'm beached at this point.
>>
>> t.
>>
>> --
>>

>
> Try running it without the --debug argument and see what happens. I'm
> sure somebody else can explain why, but the LoadError messages are
> common in debug output when using require. (Maybe it has something to
> do with gems?) Those errors don't have useful (to you) stack traces.
>
> Anyway, when I run your example with debug, I get the errors you
> posted followed by an error stating that 'index.html' is not found
> (because I didn't create one). So, your script is working; you're just
> getting confused by other libraries' debug output.
>
>
>

Thank you very much. You were right. No "--debug" = no error messages.
Game on. Thanks for rescuing me from my ignorance!

t.


--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< http://www.velocityreviews.com/forums/(E-Mail Removed) >> (email)
<< TomCloyd.com >> (website & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different VHDL-interpretation between Xilinx ISE/ModelSimXE? Thomas Thorsen VHDL 2 03-18-2006 12:11 PM
Interpretation of registry log of tweakui produced registry alteration vincemoon@rcn.com ASP .Net 0 01-10-2005 02:53 AM
Scope interpretation - Bug in ModelTech? Wallclimber VHDL 3 05-26-2004 10:48 PM
EXAM 70-226 query and interpretation? Dean Puhalovich MCSE 3 07-18-2003 01:54 PM
jni error message interpretation tupolev Java 2 06-30-2003 02:33 PM



Advertisments