# Library Require

**URL:** <https://www.ruby-forum.com/t/library-require/87145>\
**Category:** Rails\
**Created:** [February 28, 2007, 2:41pm UTC](https://www.ruby-forum.com/t/library-require/87145 "2007-02-28T14:41:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zukjimote](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/df705f/32.png) [@zukjimote](https://www.ruby-forum.com/u/zukjimote)\
**Post date:** [February 28, 2007, 2:41pm UTC](https://www.ruby-forum.com/t/library-require/87145/1 "2007-02-28T14:41:10Z")

</div>

I want to use the library ‘rubyful\_soup’  
([Rubyful Soup: "The brush has got entangled in it!"](http://www.crummy.com/software/RubyfulSoup/))

Using ‘gem install rubyful\_soup’ command, I installed the library.  
The library is installed at /var/lib/gems/1.8/gems/.  
When I use the library with irb, I typed

**require ‘rubyful\_soup.rb’,**

but got an error message that ruby could not find such a file  
‘rubyful\_soup.rb’.  
So after googling, I found the solution. The solution was to insert the  
statement

require ‘rubygems’

before the statement

require ‘rubyful\_soup.rb’.

It works well with irb, but I get an error message when practically  
using with a controller class in a rails application.

Please help =)

---

<div class="post-metadata">

**Author:** ![zukjimote](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/df705f/32.png) [@zukjimote](https://www.ruby-forum.com/u/zukjimote)\
**Post date:** [February 28, 2007, 3:37pm UTC](https://www.ruby-forum.com/t/library-require/87145/2 "2007-02-28T15:37:23Z")

</div>

On Feb 28, 2007, at 8:41 AM, Yohan Jo wrote:

> ‘rubyful\_soup.rb’.  
> It works well with irb, but I get an error message when practically  
> using with a controller class in a rails application.
> 
> Please help =)

require ‘rubyful\_soup’

You don’t use the .rb extension in require statements – ruby will  
figure out what kind of file to pull in (i.e., it could be a  
compiled .so file or a .bundle).

You also don’t need to ask you question more than once. There a  
plenty of people who use the mailing list rather than the forum  
interface and will see your question no matter where you put it.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![zukjimote](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/df705f/32.png) [@zukjimote](https://www.ruby-forum.com/u/zukjimote)\
**Post date:** [February 28, 2007, 4:01pm UTC](https://www.ruby-forum.com/t/library-require/87145/3 "2007-02-28T16:01:13Z")

</div>

First, I’m really sorry for asking one question three times.  
It is my mistake.

Thank you for your answer, but it also works well with irb but not with  
the individual file of a controller class.

Rob B. wrote:

> On Feb 28, 2007, at 8:41 AM, Yohan Jo wrote:
> 
> > ‘rubyful\_soup.rb’.  
> > It works well with irb, but I get an error message when practically  
> > using with a controller class in a rails application.
> > 
> > Please help =)
> 
> require ‘rubyful\_soup’
> 
> You don’t use the .rb extension in require statements – ruby will  
> figure out what kind of file to pull in (i.e., it could be a  
> compiled .so file or a .bundle).
> 
> You also don’t need to ask you question more than once. There a  
> plenty of people who use the mailing list rather than the forum  
> interface and will see your question no matter where you put it.
> 
> -Rob
> 
> Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
> removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![zukjimote](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/df705f/32.png) [@zukjimote](https://www.ruby-forum.com/u/zukjimote)\
**Post date:** [March 2, 2007, 12:18am UTC](https://www.ruby-forum.com/t/library-require/87145/4 "2007-03-02T00:18:05Z")

</div>

On Feb 28, 2007, at 10:01 AM, Yohan Jo wrote:

> First, I’m really sorry for asking one question three times.  
> It is my mistake.
> 
> Thank you for your answer, but it also works well with irb but not  
> with  
> the individual file of a controller class.

Can you post your error message? You can also try putting the  
require statement inside your config/environment.rb file.

-Rob

---

<div class="post-metadata">

**Author:** ![zukjimote](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/df705f/32.png) [@zukjimote](https://www.ruby-forum.com/u/zukjimote)\
**Post date:** [March 1, 2007, 2:55am UTC](https://www.ruby-forum.com/t/library-require/87145/5 "2007-03-01T02:55:13Z")

</div>

I think I found the solution: just rebooting the web server, i.e.  
webrick.

Yohan Jo wrote:

> I want to use the library ‘rubyful\_soup’  
> ([Rubyful Soup: "The brush has got entangled in it!"](http://www.crummy.com/software/RubyfulSoup/))
> 
> Using ‘gem install rubyful\_soup’ command, I installed the library.  
> The library is installed at /var/lib/gems/1.8/gems/.  
> When I use the library with irb, I typed
> 
> **require ‘rubyful\_soup.rb’,**
> 
> but got an error message that ruby could not find such a file  
> ‘rubyful\_soup.rb’.  
> So after googling, I found the solution. The solution was to insert the  
> statement
> 
> require ‘rubygems’
> 
> before the statement
> 
> require ‘rubyful\_soup.rb’.
> 
> It works well with irb, but I get an error message when practically  
> using with a controller class in a rails application.
> 
> Please help =)

---

<div class="post-metadata">

**Author:** ![zukjimote](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/df705f/32.png) [@zukjimote](https://www.ruby-forum.com/u/zukjimote)\
**Post date:** [March 2, 2007, 3:54am UTC](https://www.ruby-forum.com/t/library-require/87145/6 "2007-03-02T03:54:21Z")

</div>

Rob B. wrote:

> Can you post your error message? You can also try putting the  
> require statement inside your config/environment.rb file.
> 
> -Rob

I have solved the problem, so I cannot get the error message.  
I remember the error message was like,

Cannot load such a file ‘rubyful\_soup’

And I can’t remember the rest.
