[MacRuby-devel] Problems with DRB and MacRuby 0.5
Gaz Liddon
gaz at gazaxian.com
Sun Nov 1 09:42:06 PST 2009
Hiya :)
I've a problem using Drb and get a problem I don't get if I use bog
standard ruby 1.8
My client and server code is below.
The server works fine but if I try and invoke any method on the client
from the server I get this error:
core:in `open:': can't convert NSMutableDictionary into String
(TypeError)
from /Library/Frameworks/MacRuby.framework/Versions/0.5/usr/lib/ruby/
1.9.0/drb/drb.rb:1196:in `initialize:'
from core:in `__new__:'
from /Library/Frameworks/MacRuby.framework/Versions/0.5/usr/lib/ruby/
1.9.0/drb/drb.rb:1163:in `open:'
from /Library/Frameworks/MacRuby.framework/Versions/0.5/usr/lib/ruby/
1.9.0/drb/drb.rb:1109:in `with_friend:'
from /Library/Frameworks/MacRuby.framework/Versions/0.5/usr/lib/ruby/
1.9.0/drb/drb.rb:1091:in `method_missing:'
from /Users/garyliddon/drbtest.rb:1:in `<main>'
Any help super gratefully received :)
gaz
SERVER CODE
require 'drb'
class Incrementer
def initialize
@value = 0
end
def increment
@value += 1
end
end
service = DRb.start_service("druby://localhost:4242", Incrementer.new)
print "service started on port 4242\n"
DRb.thread.join
CLIENT CODE
require 'drb'
DRb.start_service
server = DRbObject.new_with_uri('druby://localhost:4242')
p server.increment #this is what causes the error
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20091101/1f2f2d8b/attachment.html>
More information about the MacRuby-devel
mailing list