acts_as_ferret with Drb :

Hi,

I try to deploy an application using ferret and acts_as_ferret. It's ok in devevelpment (Win) and production (Ubuntu) mode without Drb.

But when I enable Drb, acts_as_ferret create troubles. I get a message :

ferret server error undefined method `to_doc' for #<DRb::DRbUnknown: 0xb75f66dc> (full stack at the end)

I don't understand, all the afternoon trying to solve it, but without succes. I found things on Google, but it was not enough. Know i really need help.

I use : - Rails 2.0.2 - Stable acts_as_ferret - ferret 0.11.6 - Ruby 1.8.6 - Ubuntu server 8.04 LTS as production server - Passenger

For acts_as_ferret I use : - :fields with some model fields, and specific methods to add data to index - :remote (but it seems to by obsolete, same without it) - :index

What's wrong with Drb (or me, of course) ?

Thanks for any help.

Sam.

I did a mistake in my post. It's ":index_dir", not ":index" (post is wrong, but code is ok). Sorry.

Before somebody suggest it ... I already tried this "workaround", it does not work for me :

I get the same error before, in my case it's caused by some non-string fields, so I think you can have a check on your ferret indexed fields: are they all string?

Good luck, Jan

* Sam. <sgfgay@gmail.com> [2008-05-22 12:48:56 -0700]:

Thanks, it's almost that.

In fact the problem was really obvious, it was a wrong field : I used association name of the model ! I read many many times the code without seeing it, and didn't tested this data in the index in dev mode (for later use). The solution came yesterday very very late. What is really disturbing is the fact that it seems to un well in dev mode (other fields was wall indexed).

Solution (I used for other fields like date or other associations) : using methods like "ferret_my_special_data" and adding ":ferret_my_special_data" in :fields option of AAF.

Sometimes the thing is so simple, and we search so far, so crazy things... like a beginner. I hope my lesson about AAF will help others and they will not spend hours for so stupid mistake :wink:

Sam.