[MacRuby-devel] [MacRuby] #416: DRB does not work with MacRuby 5.0
MacRuby
ruby-noreply at macosforge.org
Sun Nov 1 11:05:25 PST 2009
#416: DRB does not work with MacRuby 5.0
------------------------------+---------------------------------------------
Reporter: gaz@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords: drb
------------------------------+---------------------------------------------
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
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/416>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list