Acts_as_ferret error: DRbServerNotFound


#1

Hi,

I am trying to get acts_as_ferret to work in my Rails 2 app. I am using
the acts_as_ferret 0.4.8 and ferret 0.11.6 gems.

I am trying to search a Profile model in my application that has the
following code:

acts_as_ferret(:fields => { :first_name => {:store => :no,
:index => :yes,
:term_vector =>
:with_positions_offsets,
:boost => 10.0},
:last_name => {:store => :no,
:index => :yes,
:term_vector =>
:with_positions_offsets,
:boost => 1.0}
},
:ferret => {
:analyzer =>
AppAnalyzer::CustomAnalyzer.new,
:or_default => true
}
)

The problems started in my production environment, so I am now using the
DRb server in my development environment to find the problem. In both
cases I am getting the following error in my acts_as_ferret.log file:

index_for [Profile(id: integer, user_id: integer, first_name: string,
last_name: string, website: string, blog: string, created_at: datetime,
updated_at: datetime, icon_file_name: string, icon_content_type: string,
icon_file_size: integer, icon_updated_at: datetime, age: integer,
birthDate: date, city: string, country: string)]
options: {:offset=>0, :limit=>1024, :lazy=>true, :page=>nil}
ar_options: {}
[profile] lazy_find: first_name:james~ last_name:james~
[profile] DRb connection error: DRb::DRbServerNotFound
[profile]
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1658:in
current_server' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1726:into_id’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1055:in
initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:642:innew’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:642:in
make_proxy' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:559:indump’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:603:in
send_request' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:602:ineach’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:602:in
send_request' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:908:insend_request’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1201:in
send_message' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1093:inmethod_missing’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1177:in
open' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1092:inmethod_missing’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1110:in
with_friend' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/drb/drb.rb:1091:inmethod_missing’
/Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/remote_index.rb:36:in
find_ids' /Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/remote_functions.rb:26:inhandle_drb_error’
/Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/remote_functions.rb:15:in
old_handle_drb_error' /Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/remote_functions.rb:26:inhandle_drb_error’
/Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/remote_functions.rb:33:in
handle_drb_restart' /Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/remote_functions.rb:25:inhandle_drb_error’
/Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/remote_index.rb:36:in
find_ids' /Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/ferret_find_methods.rb:28:inlazy_find’
/Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/ferret_find_methods.rb:10:in
find_records' /Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/acts_as_ferret.rb:348:infind’
/Library/Ruby/Gems/1.8/gems/acts_as_ferret-0.4.8/lib/class_methods.rb:152:in
find_with_ferret' /Users/jose/Development/AptanaRadRailsWorkspace/helpeat_tog/app/models/profile.rb:74:insite_search’
/Users/jose/Development/AptanaRadRailsWorkspace/helpeat_tog/vendor/plugins/tog_core/app/models/tog/search.rb:46:in
search' /Users/jose/Development/AptanaRadRailsWorkspace/helpeat_tog/vendor/plugins/tog_core/app/models/tog/search.rb:41:ineach’
/Users/jose/Development/AptanaRadRailsWorkspace/helpeat_tog/vendor/plugins/tog_core/app/models/tog/search.rb:41:in
search' /Users/jose/Development/AptanaRadRailsWorkspace/helpeat_tog/app/controllers/search_controller.rb:6:insearch’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in
send' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:inperform_action_without_filters’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in
call_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:638:inrun_before_filters’
/Users/jose/Development/AptanaRadRailsWorkspace/helpeat_tog/vendor/plugins/tog_core/lib/url_writer_retardase_inhibitor.rb:20:in
retardase_inhibitor' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:insend’
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in
evaluate_method' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:186:incall’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:635:in
run_before_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:615:incall_filters’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in
perform_action_without_benchmark' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in
ms' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:308:inrealtime’
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in
ms' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in
perform_action_without_flash' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:inperform_action’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in
send' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:inprocess_without_filters’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in
process' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:inprocess’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in
call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:incall’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in
dispatch' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in_call’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
build_middleware_stack' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:incall’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in
call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in
call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:incall’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstract_store.rb:122:in
call' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:incall’
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
cache' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:incache’
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in
call' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:incall’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in
call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
synchronize' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:incall’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in
call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:inrun’
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in
call' /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:ineach’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in call' /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in
call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:incall’
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in
process' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:inprocess_client’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
each' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:inprocess_client’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
run' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:ininitialize’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
new' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:inrun’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
initialize' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:innew’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
run' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:inrun’
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in
gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:inrequire’
./script/server:3
-e:2:in `load’
-e:2
Query: first_name:james~ last_name:james~
total hits: 0, results delivered: 0

In ferret_server.yml I have the following configuration:

production:
host: 127.0.0.1
port: 9010
pid_file: log/ferret.pid
log_file: log/ferret_server.log
log_level: info

development:
host: 127.0.0.1
port: 9090
pid_file: log/ferret.pid
log_file: log/ferret_server.log
log_level: debug

And I start the DRb server with the command:

script/ferret_server -R . -d development start (in dev. environment)

Any ideas what the problem may be?

During my debugging I have been able to connect to the DRb server
through an IRB session and it seems to be working OK (I managed to get
results for a hand-made query).

Thanks!