Ruby+Tcl/Tk+Cygwin

Hello List!

So years ago – in the before time, around 2008-2010 – I set up cygwin
with ruby; I also installed active state tcl/tk. I used this to provide
some simple programs for my employer, and everything worked fine.

Now, I update cygwin and ruby, and run the programs, and I get this:

/usr/lib/ruby/1.8/tk.rb:1127:in initialize': tcltklib: fail to Tk_Init(). no display name and no $DISPLAY environment variable (RuntimeError) from /usr/lib/ruby/1.8/tk.rb:1127:innew’
from /usr/lib/ruby/1.8/tk.rb:1127

And examining the file doesn’t help me understand what’s going on. To
reproduce this, I did the following:

ruby -r tk -e ‘’

Is this a problem on the ruby side? With ActiveTcl? Should I use
XWindows
somehow with cygwin since it’s asking for Display?

  • Cygwin installed today
  • ruby version is ruby 1.8.7 (2012-02-08 patchlevel 358) [i386-cygwin]
  • ActiveState Tcl was installed using
    “ActiveTcl8.5.11.1.295590-win32-ix86-threaded” installer.

Thank you kindly for any help, or even just saying “Hey, this sounds
like
you wanna ask ActiveState or Cygwin instead…”

~Matthew

On Thu, 2012-03-22 at 00:51 +0900, Matt Maycock wrote:

Hello List!

/usr/lib/ruby/1.8/tk.rb:1127:in initialize': tcltklib: fail to Tk_Init(). no display name and no $DISPLAY environment variable (RuntimeError) from /usr/lib/ruby/1.8/tk.rb:1127:innew’
from /usr/lib/ruby/1.8/tk.rb:1127
snip
Is this a problem on the ruby side? With ActiveTcl? Should I use
XWindows somehow with cygwin since it’s asking for Display?

The active state tcl/tk is windows based.
The cygwin tcl/tk is X-windows based.
It looks like the cygwin tcl/tk got invoked.
Try starting the cygwin X server, and invoke your script from the xterm
that starts up with it