# Acts\_as\_ferret with Drb :

**URL:** <https://www.ruby-forum.com/t/acts-as-ferret-with-drb/138414>\
**Category:** Rails\
**Created:** [May 22, 2008, 7:32pm UTC](https://www.ruby-forum.com/t/acts-as-ferret-with-drb/138414 "2008-05-22T19:32:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 22, 2008, 7:32pm UTC](https://www.ruby-forum.com/t/acts-as-ferret-with-drb/138414/1 "2008-05-22T19:32:33Z")

</div>

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.

* * *

ferret server error undefined method `to\_doc’ for #\<DRb::DRbUnknown:  
0xb75f66dc\>

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/local\_index.rb:166:in `add’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/ferret\_server.rb:102:in `send’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/ferret\_server.rb:102:in `method\_missing’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/ferret\_server.rb:170:in `reconnect\_when\_needed’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/ferret\_server.rb:97:in `method\_missing’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/ferret\_server.rb:164:in `with\_class’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/ferret\_server.rb:96:in `method\_missing’

/usr/lib/ruby/1.8/drb/drb.rb:1555:in ` **send** ’

/usr/lib/ruby/1.8/drb/drb.rb:1555:in `perform\_without\_block’

/usr/lib/ruby/1.8/drb/drb.rb:1515:in `perform’

/usr/lib/ruby/1.8/drb/drb.rb:1589:in `main\_loop’

/usr/lib/ruby/1.8/drb/drb.rb:1585:in `loop’

/usr/lib/ruby/1.8/drb/drb.rb:1585:in `main\_loop’

/usr/lib/ruby/1.8/drb/drb.rb:1581:in `start’

/usr/lib/ruby/1.8/drb/drb.rb:1581:in `main\_loop’

/usr/lib/ruby/1.8/drb/drb.rb:1430:in `run’

/usr/lib/ruby/1.8/drb/drb.rb:1427:in `start’

/usr/lib/ruby/1.8/drb/drb.rb:1427:in `run’

/usr/lib/ruby/1.8/drb/drb.rb:1347:in `initialize’

/usr/lib/ruby/1.8/drb/drb.rb:1627:in `new’

/usr/lib/ruby/1.8/drb/drb.rb:1627:in `start\_service’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/ferret\_server.rb:79:in `start’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/unix\_daemon.rb:18:in `call’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/unix\_daemon.rb:18:in `platform\_daemon’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/unix\_daemon.rb:41:in `fork’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/unix\_daemon.rb:41:in `safefork’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/unix\_daemon.rb:11:in `platform\_daemon’

/var/www/ged\_demo/releases/20080522125753/vendor/plugins/  
acts\_as\_ferret/lib/ferret\_server.rb:77:in `start’

./script/…/vendor/plugins/acts\_as\_ferret/lib/server\_manager.rb:41:in  
`send’

./script/…/vendor/plugins/acts\_as\_ferret/lib/server\_manager.rb:41

script/ferret\_server:4:in `require’

script/ferret\_server:4

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 22, 2008, 9:49pm UTC](https://www.ruby-forum.com/t/acts-as-ferret-with-drb/138414/2 "2008-05-22T21:49:45Z")

</div>

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 :  
[http://www.ruby-forum.com/topic/131198#585582](http://www.ruby-forum.com/topic/131198#585582)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 23, 2008, 7:41am UTC](https://www.ruby-forum.com/t/acts-as-ferret-with-drb/138414/3 "2008-05-23T07:41:37Z")

</div>

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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) [2008-05-22 12:48:56 -0700]:

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 23, 2008, 8:39am UTC](https://www.ruby-forum.com/t/acts-as-ferret-with-drb/138414/4 "2008-05-23T08:39:38Z")

</div>

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 😉

Sam.
