Uninitialized constant Ferret

I get this error message from the following code:

require ‘rubygems’
require ‘ferret’
include Ferret

index = Index::Index.new(:path => ‘/tmp/index’)

index << {:title => “Programming Ruby”, :content => “blah blah blah”}
index << {:title => “Programming Ruby”, :content => “yada yada yada”}

Yes, gems is installed and ferret is as well. Here’s the exact output:

./ferret.rb:3: uninitialized constant Ferret (NameError)
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
require__' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:inrequire’
from test_ferret.rb:2

Any ideas what I’m doing wrong? Ruby version 1.8.2

Thanks!
John

John W. wrote:

`require’
from test_ferret.rb:2

Any ideas what I’m doing wrong? Ruby version 1.8.2

I think it’s because you’ve called your file ‘ferret.rb’.
It’s requiring itself.

Mark J. wrote:

John W. wrote:

`require’
from test_ferret.rb:2

Any ideas what I’m doing wrong? Ruby version 1.8.2

I think it’s because you’ve called your file ‘ferret.rb’.
It’s requiring itself.

Hah…so it is! I changed it in the output I posted because I thought it
might lead to confusion, but it never occurred to me that it might be
causing problems for ruby itself.

Working now…thanks!

John