All, At the top of my controller, I have: require ''rubygems'' require_gem ''rubyful_soup'' The rubyful_soup gem has been successfully installed. However, when I go to instantiate a class from it, using parser = BeautifulSoup.new(html) I get uninitialized constant BeautifulSoup Is there something else I need to do to see the symbols in the Rubyful Soup gem? Thanks, Wes P. S. I had this working like 10 minutes ago but I don''t know how - to be honest. -- Posted via http://www.ruby-forum.com/.
OK, Here''s the total error Why is it trying to load a file name beautiful_soup.rb? I mean, I kind of know why - because I''m invoking a class whose name is BeautifulSoup. But how do I make Ruby know that the BeautifulSoup class is in rubyful_soup.rb, which I have successfully "required"? Wes ============================================= c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in `const_missing'' #{RAILS_ROOT}/app/controllers/e_simply_controller.rb:71:in `has_local_images?'' #{RAILS_ROOT}/app/controllers/e_simply_controller.rb:43:in `save_HTML'' This error occured while loading the following files: beautiful_soup.rb Wes Gamble wrote:> All, > > At the top of my controller, I have: > > require ''rubygems'' > require_gem ''rubyful_soup'' > > The rubyful_soup gem has been successfully installed. > > However, when I go to instantiate a class from it, using > > parser = BeautifulSoup.new(html) > > I get > > uninitialized constant BeautifulSoup > > Is there something else I need to do to see the symbols in the Rubyful > Soup gem? > > Thanks, > Wes > > P. S. I had this working like 10 minutes ago but I don''t know how - to > be honest.-- Posted via http://www.ruby-forum.com/.
OK, I bounce my browser and it works. That makes no #@*#$@*@#$@&*#$)@$& sense. Can anyone enlighten me as to why my browser caching makes any difference to the successful use of a gem in my controller? Wes Wes Gamble wrote:> OK, > > Here''s the total error > > Why is it trying to load a file name beautiful_soup.rb? I mean, I kind > of know why - because I''m invoking a class whose name is BeautifulSoup. > But how do I make Ruby know that the BeautifulSoup class is in > rubyful_soup.rb, which I have successfully "required"? > > Wes > > =============================================> > c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in > `const_missing'' > #{RAILS_ROOT}/app/controllers/e_simply_controller.rb:71:in > `has_local_images?'' > #{RAILS_ROOT}/app/controllers/e_simply_controller.rb:43:in `save_HTML'' > This error occured while loading the following files: > beautiful_soup.rb > > Wes Gamble wrote: >> All, >> >> At the top of my controller, I have: >> >> require ''rubygems'' >> require_gem ''rubyful_soup'' >> >> The rubyful_soup gem has been successfully installed. >> >> However, when I go to instantiate a class from it, using >> >> parser = BeautifulSoup.new(html) >> >> I get >> >> uninitialized constant BeautifulSoup >> >> Is there something else I need to do to see the symbols in the Rubyful >> Soup gem? >> >> Thanks, >> Wes >> >> P. S. I had this working like 10 minutes ago but I don''t know how - to >> be honest.-- Posted via http://www.ruby-forum.com/.