# Successfully importing Rubyful Soup objects

**URL:** <https://www.ruby-forum.com/t/successfully-importing-rubyful-soup-objects/85608>\
**Category:** Rails\
**Created:** [March 22, 2006, 10:33pm UTC](https://www.ruby-forum.com/t/successfully-importing-rubyful-soup-objects/85608 "2006-03-22T22:33:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 22, 2006, 10:33pm UTC](https://www.ruby-forum.com/t/successfully-importing-rubyful-soup-objects/85608/1 "2006-03-22T22:33:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 22, 2006, 10:51pm UTC](https://www.ruby-forum.com/t/successfully-importing-rubyful-soup-objects/85608/2 "2006-03-22T22:51:27Z")

</div>

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 G. 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.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 22, 2006, 11:01pm UTC](https://www.ruby-forum.com/t/successfully-importing-rubyful-soup-objects/85608/3 "2006-03-22T23:01:18Z")

</div>

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 G. 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 G. 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.
