I just installed the rbcw version of Ruby on my box, including cygwin.
Simple programs run fine. However, when I run any Tk related scripts,
they choke. For example, when I run the simplest Tk script, tkhello.rb,
I get the following:
----------------------------------
C:\Ruby>ruby sample\tkhello.rb
/cygdrive/c/RUBY/lib/tcltklib.rb:7:in `+': failed to convert nil into
String (TypeError)
from /cygdrive/c/RUBY/lib/tcltklib.rb:7
from /cygdrive/c/RUBY/lib/tk.rb:7:in `require'
from /cygdrive/c/RUBY/lib/tk.rb:7
from sample\tkhello.rb:1:in `require'
from sample\tkhello.rb:1
--------------------------------------
Any idea what's causing the problem and how I fix it? The problem isn't
that I don't have Tk on my box; I can run Tk just fine from Python. Any
suggestions would be greatly appreciated.
Thanks,
Anders Schneiderman
The National Journal
P.S. This is what's in tkhello.rb:
require "tk"
TkButton.new(nil,
'text' => 'hello',
'command' => proc{print "hello\n"}).pack('fill'=>'x')
TkButton.new(nil,
'text' => 'quit',
'command' => 'exit').pack('fill'=>'x')
Tk.mainloop
Sent via Deja.com http://www.deja.com/
Before you buy.