Hello,
I’ve been using the acts_as_ferret plugin quite successfully on my rail
application… until i needed to add namespaces to it! Could anybody
help me on this?
At first, my application had only one part, related to people/companies
called “Entities”. Everything was fine, my ferret was happy.
Then, I had to add a new part : “Publications”. I decided to split the
application :
- The common part, with administration pages, user management,…
- The Entities part (still ferret-powered)
- The Publications part (ferret-free)
I did so by creating subfolders in my controllers / models / helpers /
views:
The common part stays where it is.
The entities go to the Entities sub folder.
The publications go to the Publications sub folder.
I got all this little world to work fine locally on my development
environment.
Now, when it comes to deploying it to the production server, it seems to
all go wrong. My ferret gets sick and tries to ruin everything:
NameError (uninitialized constant Entities):
(druby://198.145.115.78:9010)
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:266:in
load_missing_constant' (druby://198.145.115.78:9010) /var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in
const_missing’
(druby://198.145.115.78:9010)
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:464:in
const_missing' (druby://198.145.115.78:9010) /var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/inflector.rb:250:in
constantize’
(druby://198.145.115.78:9010)
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/string/inflections.rb:148:in
constantize' (druby://198.145.115.78:9010) ./script/../config/../vendor/plugins/acts_as_ferret/lib/ferret_server.rb:112:in
with_class’
(druby://198.145.115.78:9010)
./script/…/config/…/vendor/plugins/acts_as_ferret/lib/ferret_server.rb:78:in
ensure_index_exists' /vendor/plugins/acts_as_ferret/lib/remote_index.rb:16:in
send’
/vendor/plugins/acts_as_ferret/lib/remote_index.rb:16:in
method_missing' /vendor/plugins/acts_as_ferret/lib/act_methods.rb:182:in
acts_as_ferret’
/app/models/entities/spec.rb:36
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
require’
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require' /var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
new_constants_in’
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
require' /var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:104:in
require_or_load’
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:248:in
load_missing_constant' /var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in
const_missing’
/app/controllers/entities/spec_controller.rb:112:in view' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in
send’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1095:in
perform_action_without_filters' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in
call_filter’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
call_filter' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
call’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
call_filter' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:634:in
call_filter’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
call_filter' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
call’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
call_filter' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
call_filter’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
call' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
call_filter’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
call_filter' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
call’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
call_filter' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:in
measure’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
perform_action_without_rescue' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
perform_action’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
send' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
process_without_filters’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in
process_without_session_management_support' /var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
process’
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in
process' /var/lib/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
dispatch’
/var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in
process' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
synchronize’
/var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
process' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
process_client’
/var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in each' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
process_client’
/var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in run' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
initialize’
/var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in new' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
run’
/var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
initialize' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
new’
/var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in run' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in
run’
/var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
each' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
run’
/var/lib/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in run' /var/lib/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in
run’
/var/lib/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243
/usr/local/bin/mongrel_rails:18:in `load’
/usr/local/bin/mongrel_rails:18
I can see two lines that are directly related to my code:
/app/controllers/entities/spec_controller.rb:112:in `view'
Which is :
110 def view
111 begin
112 @spec = Entities::Spec.find(params[:id])
and
/app/models/entities/spec.rb:36
Which is :
36 acts_as_ferret :remote => true
Could anybody tell me what’s wrong with my ferret? Is there more
information i could provide to make troubleshooting easier?
Thank you,
Francois