# Ruby Tk and DRb

**URL:** https://rubytalk.org/t/ruby-tk-and-drb/23004
**Category:** ruby-talk
**Created:** [5 December 2005 10:05 UTC](https://rubytalk.org/t/ruby-tk-and-drb/23004 "2005-12-05T10:05:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Alex\_Piel](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Alex\_Piel](https://rubytalk.org/u/Alex_Piel)
#### Post date: [5 December 2005 10:05 UTC](https://rubytalk.org/t/ruby-tk-and-drb/23004/1 "2005-12-05T10:05:11Z")

</div>

Hello @ all!

I wrote a little test code using RubyTk and DRb. But somehow I get  
strange errors:

(druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:2020:in `\_\_invoke':  
can't invoke "wm" command: application has been destroyed  
(RuntimeError) (DRb::DRbRemoteError)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:2020:in  
`\_invoke'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:1549:in  
`\_ip\_invoke\_core'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:1583:in  
`\_tk\_call\_core'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (druby://localhost:9000) /usr/lib/ruby/1.8/tk.rb:1607:in  
`tk\_call'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from (druby://localhost:9000) /usr/lib/ruby/1.8/tk/wm.rb:271:in  
`title'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from client.rb:7

I don't know why and I hope somebody can help me with this code! Here it  
is:

--\> SERVER.rb:

&nbsp;&nbsp;&nbsp;&nbsp;require "drb"  
&nbsp;&nbsp;&nbsp;&nbsp;require "tk"

&nbsp;&nbsp;&nbsp;&nbsp;class Test  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def startup  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root = TkRoot.new('title'=\>"Hallo", 'geometry'=\>"200x200")  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;end

&nbsp;&nbsp;&nbsp;&nbsp;test = Test.new  
&nbsp;&nbsp;&nbsp;&nbsp;test.startup

&nbsp;&nbsp;&nbsp;&nbsp;DRb.start\_service('druby://localhost:9000', test)  
&nbsp;&nbsp;&nbsp;&nbsp;Tk.mainloop  
&nbsp;&nbsp;&nbsp;&nbsp;DRb.thread.join

> **···**
>
> --------------------------------------------------------------------------------
> 
> --\> CLIENT.rb:
> 
> &nbsp;&nbsp;&nbsp;&nbsp;require "drb"  
> &nbsp;&nbsp;&nbsp;&nbsp;require "tk"
> 
> &nbsp;&nbsp;&nbsp;&nbsp;DRb.start\_service()  
> &nbsp;&nbsp;&nbsp;&nbsp;obj = DRbObject.new(nil, 'druby://localhost:9000')
> 
> &nbsp;&nbsp;&nbsp;&nbsp;root = obj.startup
> 
> &nbsp;&nbsp;&nbsp;&nbsp;Tk.mainloop
> 
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
