Forum: Ruby on Rails Successfully importing Rubyful Soup objects

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-03-22 22:33
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.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-03-22 22:51
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.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-03-22 23:01
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.
This topic is locked and can not be replied to.