Library Require

I want to use the library ‘rubyful_soup’
(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 =)

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
[email protected]

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
[email protected]

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

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’
(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 =)

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs