Joel Hayhurst
2006-Aug-03 21:20 UTC
[Backgroundrb-devel] undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4>
I tried installing BackgrounDRb today. Followed the readme, made a little worker for myself and executed it within the code. But I keep getting this error. I must''ve gone over the README a zillion times. Any idea what it is? undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4>
James Hughes
2006-Aug-03 21:40 UTC
[Backgroundrb-devel] undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4>
On 8/3/06, Joel Hayhurst <joel at luckyoliver.com> wrote:> I tried installing BackgrounDRb today. Followed the readme, made a > little worker for myself and executed it within the code. But I keep > getting this error. I must''ve gone over the README a zillion times. > Any idea what it is? > > undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4>Hi, I believe that if you are passing any model objects as args to your worker, you need this line somewhere in you model''s class definition: include DRbUndumped hth, jh -- James Hughes Web application developer Vancouver, BC "Developing a coherent political analysis is in many respects contingent upon an ability to connect one context to another, a process not dissimilar to playing the kid''s game of dot-to-dot." - Ward Churchill, from ''"A Government of Laws"?''
Ezra Zygmuntowicz
2006-Aug-03 22:41 UTC
[Backgroundrb-devel] undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4>
On Aug 3, 2006, at 2:20 PM, Joel Hayhurst wrote:> I tried installing BackgrounDRb today. Followed the readme, made a > little worker for myself and executed it within the code. But I keep > getting this error. I must''ve gone over the README a zillion times. > Any idea what it is? > > undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4> > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >It looks like you are trying to use one of your models across the wire. What classes are involved in this error? Can you show us your code in rails and in the worker please? I think you will be able to solve this by including DRbUndumpoed in your classes that are involved. So if you have a Post model that you need to send across the wire to a worker then you will need to add this line to the class def: class Post < AR::Base include DRbUndumped end That will fix the DRbUnknown errors for you. -Ezra
Joel Hayhurst
2006-Aug-03 23:09 UTC
[Backgroundrb-devel] undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4>
This did indeed fix the problem, thanks to both of you, Ezra and James! I''ll let you know if I have any other issues. On Aug 3, 2006, at 3:41 PM, Ezra Zygmuntowicz wrote:> > On Aug 3, 2006, at 2:20 PM, Joel Hayhurst wrote: > >> I tried installing BackgrounDRb today. Followed the readme, made a >> little worker for myself and executed it within the code. But I keep >> getting this error. I must''ve gone over the README a zillion times. >> Any idea what it is? >> >> undefined method `[]'' for #<DRb::DRbUnknown:0x2501bd4> >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel >> > > It looks like you are trying to use one of your models across the > wire. What classes are involved in this error? Can you show us your > code in rails and in the worker please? I think you will be able to > solve this by including DRbUndumpoed in your classes that are > involved. So if you have a Post model that you need to send across > the wire to a worker then you will need to add this line to the class > def: > > class Post < AR::Base > include DRbUndumped > > end > > > That will fix the DRbUnknown errors for you. > > -Ezra > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel