1

We've been using ferret in a rails 2.2.2 app for years, and it's been fine (with a few quirks).

Now, though, whenever I try to use it locally, it just dies. I can start it up, and then as soon as Rails (in my local server, or in the console) tries to do a ferret search, the ferret server disappears.

The only feedback I can get is from log/acts_as_ferret.log, which has this:

Will use remote index server which should be available at druby://localhost:9010
[user] DRb connection error: connection closed
[digilearning_support_file] DRb connection error: druby://localhost:9010 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>
[asset] DRb connection error: druby://localhost:9010 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>
[cmw_step_resource] DRb connection error: druby://localhost:9010 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>
/home/max/work/charanga/elearn_container/elearn/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:354 ###index_for [DigilearningTitle(id: integer, name: string, description: text, created_at: datetime, updated_at: datetime, folder_name: string, user_id: integer, summary: text, disk_space_in_megabytes: float, top_level_live_content: boolean, live_content: boolean)]
/home/max/work/charanga/elearn_container/elearn/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:338 ###options: {:offset=>nil, :limit=>nil}
ar_options: {}
[digilearning_title] DRb connection error: druby://localhost:9010 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>
[digilearning_title] /home/max/work/charanga/elearn_container/elearn/vendor/plugins/acts_as_ferret/lib/ferret_find_methods.rb:42 ### now retrieving records from AR: id_arrays = {}, options: {}
[digilearning_title] /home/max/work/charanga/elearn_container/elearn/vendor/plugins/acts_as_ferret/lib/ferret_find_methods.rb:43 ### total_ids in id_arrays = 0 (uniq version of this is 0
/home/max/work/charanga/elearn_container/elearn/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:440 ### find_options = {}
[digilearning_title] /home/max/work/charanga/elearn_container/elearn/vendor/plugins/acts_as_ferret/lib/ferret_find_methods.rb:45 ###0 results from AR
[digilearning_title] /home/max/work/charanga/elearn_container/elearn/vendor/plugins/acts_as_ferret/lib/ferret_find_methods.rb:69 ### total_hits = 0
/home/max/work/charanga/elearn_container/elearn/vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:341 ###Query: "Music"
total hits: 0, results delivered: 0

After I start it, i can see with ps that it's running. But when I start up the rails console, ferret dies. I start ferret with script/ferret_server start, which in turn just requires a file:

#!/usr/bin/env ruby

begin
  require File.join(File.dirname(__FILE__), '../vendor/plugins/acts_as_ferret/lib/server_manager')
rescue LoadError
  puts "Got a LoadError"
  # try the gem
  require 'rubygems'
  gem 'acts_as_ferret'
  require 'server_manager'
end

It's not outputting anything so it's not getting an exception trying to require that file.

I can't understand what has suddenly made it fail like this, though I have been making some changes to what is indexed, for one of the models. I can revert these changes and the problem doesn't go away though.

I don't know how to debug this... can anyone help? thanks

EDIT: I tried deleting all the contents of my index/development folder, thinking there might be something weird in there, but it didn't help.

Max Williams
  • 32,435
  • 31
  • 130
  • 197

0 Answers0