Hi, I have already posted this question to the Ruby list, but it may be
a Rails-related problem, so I''m cross-posting.
I''ve run into a wierd problem with the Hpricot gem. I don''t
know if
this is a problem with gems in general on my system, or if it''s
specific
to Hpricot, so I''m posting here.
Basically I have code as follows:
require ''rubygems''
require ''net/http''
require ''uri''
require_gem ''hpricot''
class Page
def some_function(html_text)
doc = Hpricot(html_text)
doc.search("/html/body//img").each do |img|
logger.debug("== Found an image: #{img} ==")
src = img[/src="/]
logger.debug("src = #{src}")
end
end
end
When the function is called, sometimes I get a message saying that
function Hpricot does not exist for the object of type Page. this
continues for the entire programming session.
But sometimes, when I sit down to work on the project, the code works!
It continues working until I restart the Rails server (this is a Rails
project running on MacOSX).
Does anyone have any idea what might be causing this problem, and how to
correct it?
Alli
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---