Ferret-0.11.4-mswin32 not compatible with Ruby1.8.4

Just a quick note for future reference - at least for me, ferret won’t
work on Ruby 1.8.4.

gem install ferret
Successfully installed ferret-0.11.4-mswin32
ruby -v
ruby 1.8.4 (2005-12-24) [i386-mswin32]
irb
irb(main):001:0> require ‘ferret’

A windows error message box appears -
ruby.exe - Entry Point Not Found
The procedure entry point rb_w32_write could not be located in the
dynamic link library msvcrt-ruby18.dll.

And the following shows in the command box.

LoadError: 127: The specified procedure could not be found. -
C:/ruby/lib/ruby
/gems/1.8/gems/ferret-0.11.4-mswin32/ext/ferret_ext.so
from
C:/ruby/lib/ruby/gems/1.8/gems/ferret-0.11.4-mswin32/ext/ferret_ext
.so
from
C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in re quire' from C:/ruby/lib/ruby/gems/1.8/gems/ferret-0.11.4-mswin32/lib/ferret.rb: 25 from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:inre
quire’
from (irb):1

Works fine on a separate installation of 1.8.5.

On 4/11/07, Sam G. [email protected] wrote:

A windows error message box appears -
C:/ruby/lib/ruby/gems/1.8/gems/ferret-0.11.4-mswin32/ext/ferret_ext
from (irb):1

Works fine on a separate installation of 1.8.5.

Hi Sam,

This is unfortunate but it would probably work both ways. That is, if
I build it for 1.8.4 it won’t work with 1.8.5.

How many people are still using Ruby 1.8.4 and are having the same
problem? If there are enough of you I could build another gem
specifically for ruby 1.8.4. Actually, Sam, if you really need me to I
could build a special gem for you. Let me know.

Cheers,
Dave

I’m getting the following error trying to set the field_infos for an
IndexWriter:

Ferret::Index is not missing constant FieldInfos! (ArgumentError)

here’s the code:

     @index_writer = Ferret::Index::IndexWriter.new(
                       :path     => my_path,
                       :create   => true,
                       :analyzer =>

Ferret::Analysis::StandardAnalyzer.new,
:merge_count => 2,
:field_infos =>
Ferret::Index::FieldInfos.load(IO.read(FIELD_INFO_FILE)))

I’m not sure what is causing the error. Any thoughts?

On 4/13/07, Erik M. [email protected] wrote:

                       :analyzer =>

Ferret::Analysis::StandardAnalyzer.new,
:merge_count => 2,
:field_infos =>
Ferret::Index::FieldInfos.load(IO.read(FIELD_INFO_FILE)))

I’m not sure what is causing the error. Any thoughts?

This is a bug in Ferret. I’ve fixed it but there is no need to wait
for the next release. Just include Ferret::Index at the start and
everything should work fine;

    include Ferret::Index
    @index_writer = IndexWriter.new(
                      :path     => my_path,
                      :create   => true,
                      :analyzer => 

Ferret::Analysis::StandardAnalyzer.new,
:merge_count => 2,
:field_infos =>
FieldInfos.load(IO.read(FIELD_INFO_FILE)))

That should fix your problem. Let me know if it doesn’t.

Cheers,
Dave

Thanks Dave. I’m still getting the same error after making that
change. I’m using Ferret 0.11.3 on OSX. Thanks again.

Erik

On 4/13/07, Erik M. [email protected] wrote:

Thanks Dave. I’m still getting the same error after making that
change. I’m using Ferret 0.11.3 on OSX. Thanks again.

Hi Erik,

Could you please try the following code and let me know if it works;

require 'rubygems'
require 'ferret'

$fi = <<-EOF
default:
  store: :yes
  index: :yes
  term_vector: :no

fields:
  id:
    index: :untokenized
    term_vector: :no

  title:
    boost: 20.0
    term_vector: :no

  content:
    term_vector: :with_positions_offsets
EOF
include Ferret::Index
@index_writer = Ferret::Index::IndexWriter.new(
                 :create   => true,
                 :analyzer => 

Ferret::Analysis::StandardAnalyzer.new,
:merge_count => 2,
:field_infos => FieldInfos.load($fi))

Thanks Dave, I will try this later. I ended up doing the following:

     field_infos = FieldInfos.new
     field_config = YAML.load(IO.read(FIELD_INFO_FILE))
     field_config.each_key do |field|
       field_infos.add_field(field, field_config[field])
     end
     @index_writer = IndexWriter.new(
                       :path     => settings.path,
                       :create   => settings.create,
                       :analyzer => settings.analyzer,
                       :merge_count => settings.merge_count,
                       :field_infos => field_infos)

Which appears to have worked.

David B. wrote:

How many people are still using Ruby 1.8.4 and are having the same
problem? If there are enough of you I could build another gem
specifically for ruby 1.8.4. Actually, Sam, if you really need me to I
could build a special gem for you. Let me know.

Hey Dave, No need. I just happened to go to test something on the 1.8.4
Windows machine - I use Debian for production and have newer ruby’s on
other computers. I just pointed this out in case someone searched on
that ‘problem’. Cheers for the offer though!

On 4/13/07, Guest [email protected] wrote:

David B. wrote:

How many people are still using Ruby 1.8.4 and are having the same
problem? If there are enough of you I could build another gem
specifically for ruby 1.8.4. Actually, Sam, if you really need me to I
could build a special gem for you. Let me know.

Hey Dave, No need. I just happened to go to test something on the 1.8.4
Windows machine - I use Debian for production and have newer ruby’s on
other computers. I just pointed this out in case someone searched on
that ‘problem’. Cheers for the offer though!

Oh, good idea. Thanks.