Using tcltk with cygwin Ruby

Hi,
I am trying to use TCL/TK with the cygwin version of Ruby. I have tcl/tk installed previously for cygwin as well and am running ruby from the cygwin environment. As I type “require ‘tk’” from irb, I get this error:

LoadError: tcltklib: tcltk_stubs init error(-1)
from /usr/local/lib/ruby/1.6/tk.rb:7:in require' from /usr/local/lib/ruby/1.6/tk.rb:7 from (irb):1:inrequire’
from (irb):1

I believe this error comes from when the tk.rb file tries to load the tcltklib.so

This shared library file was probably put there when I installed ruby. The ruby installation I used was rub-1.6.7-i386-cygwin.tar.gz.

Cygwin dll version is 1.3.12 so it is quite new.

I’ve done a search for this problem but unfortunately the references I’ve found were in Japanese so I couldn’t read and understand the fix (if it was mentioned).

Any ideas on how to fix this problem? I would prefer to stay in the cygwin environment.

Thanks,

Chee

Hi,

“Low,Chee Hoong” yvj57b5001@sneakemail.com writes:

I am trying to use TCL/TK with the cygwin version of Ruby. I have tcl/tk installed previously for cygwin as well and am running ruby from the cygwin environment. As I type “require ‘tk’” from irb, I get this error:

LoadError: tcltklib: tcltk_stubs init error(-1)
from /usr/local/lib/ruby/1.6/tk.rb:7:in require' from /usr/local/lib/ruby/1.6/tk.rb:7 from (irb):1:in require’
from (irb):1

I believe this error comes from when the tk.rb file tries to load the tcltklib.so

This shared library file was probably put there when I installed ruby. The ruby installation I used was rub-1.6.7-i386-cygwin.tar.gz.

Cygwin dll version is 1.3.12 so it is quite new.

I’ve done a search for this problem but unfortunately the references I’ve found were in Japanese so I couldn’t read and understand the fix (if it was mentioned).

Any ideas on how to fix this problem? I would prefer to stay in the cygwin environment.

  1. Install Tcl/Tk for Windows.
    http://www.scriptics.com/
  2. Define RUBY_TCL_DLL and RUBY_TK_DLL in your envrionment variables.
    Or add C:\Tcl\bin to PATH environment variable.
···


eban