Tcl interface

I'm running ruby on a kubuntu dapper installation. I compiled ruby from
source for the installation.

I just tried starting an application using the 'tcl' interface. Problem:
when I use require 'tcl', I get an error message telling me that tcl
will not load. Looking at the book, "Programming Ruby", it says that the
tcl interface is part of the standard installation. I have installed tcl
through synaptic - and it tells me that it is installed.

What do I need to do to make this package available? All help greatly
appreciated.
---Michael

···

--
Posted via http://www.ruby-forum.com/.

Michael Satterwhite wrote:

I'm running ruby on a kubuntu dapper installation. I compiled ruby from
source for the installation.

I just tried starting an application using the 'tcl' interface. Problem:
when I use require 'tcl', I get an error message telling me that tcl
will not load. Looking at the book, "Programming Ruby", it says that the
tcl interface is part of the standard installation. I have installed tcl
through synaptic - and it tells me that it is installed.

What do I need to do to make this package available? All help greatly
appreciated.
---Michael

I dunno, but you might have to build the ruby tk extension _after_ installing tk, in case it is checking for a working tk and aborting the build if it doesn't find one. Apologies in advance if this doesn't help...

···

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Joel VanderWerf wrote:

I dunno, but you might have to build the ruby tk extension _after_
installing tk, in case it is checking for a working tk and aborting the
build if it doesn't find one. Apologies in advance if this doesn't
help...

That sounds like it would work. The problem, though, is that I can't
find ANY information on building the Ruby tk interface.

I've googled, Asked, searched the ruby site all to no avail. The only
thing I've found is in the "Programming Ruby" book, which says that it's
installed as part of the ruby release.

Does anyone have any information on where to get / how to build this. I
do have tk installed on the system.

---Michael

···

--
Posted via http://www.ruby-forum.com/\.

Message-ID: <d5b0f8ad622e95e65c05c4ae704429de@ruby-forum.com>

That sounds like it would work. The problem, though, is that I can't
find ANY information on building the Ruby tk interface.

The basic library of Tcl/Tk interface on Ruby is 'tcltklib'.
Please read 'ext/tk/README.tcltklib' on the source tree.
Tk library is required to compile 'tcltklib'.
if you succed to make 'tcltklib', you will succeed "require 'tk'".
                                                             ^^
'tk' is a higher order library of Tcl/Tk interface.

If you want to use Tcl interpreters without Tk,
you have to use 'tcltklib' directly.
For example,

···

From: Michael Satterwhite <michael@weblore.com>
Subject: Re: tcl interface
Date: Sat, 24 Feb 2007 07:15:18 +0900
-------------------------------------------------------
require 'tcltklib'
ip = TclTkIp.new('', false)
ip._invoke('info', 'commands')
# or
# ip._eval('info commands')
ip.mainloop(false) # if you need
-------------------------------------------------------
Please see 'ext/tk/MANUAL_tcltklib.eng' also.
--
                                  Hidetoshi Nagai (nagai@ai.kyutech.ac.jp)

Hidetoshi NAGAI wrote:

The basic library of Tcl/Tk interface on Ruby is 'tcltklib'.
Please read 'ext/tk/README.tcltklib' on the source tree.
Tk library is required to compile 'tcltklib'.
if you succed to make 'tcltklib', you will succeed "require 'tk'".

I did. I've insured that tcl and tk (with development files) are
installed. I verified that the library files are in /usr/lib, and the
include files are in /usr/include/tcl8.4

I then rebuilt ruby with the following commands:
   make clean
   ./configure --prefix=/usr/ --with-tcllib=tcl8.4 --with-tklib=tk8.4
        --with-tcl-include =/usr/include/tcl8.4 --with-tcl-lib=/usr/lib
        --with-tk-include=/usr/include/tcl8.4 --with-tk-lib=/usr/lib
   make
   sudo make install

Still, require 'tk' fails telling me that tcltklib isn't there.

I've grepped the configure script and the makefiles for 'tcl' and 'tk'
and don't see where the configuration parameters are even used. grep tk
doesn't find anything, and grep tcl doesn't find anything practical.

Beyond that, I don't see anything to help me diagnose why tcltklib isn't
being made.

Any clues, or is it just not possible to configure?

···

'tk' is a higher order library of Tcl/Tk interface.

If you want to use Tcl interpreters without Tk,
you have to use 'tcltklib' directly.
For example,
-------------------------------------------------------
require 'tcltklib'
ip = TclTkIp.new('', false)
ip._invoke('info', 'commands')
# or
# ip._eval('info commands')
ip.mainloop(false) # if you need

--
Posted via http://www.ruby-forum.com/\.

Message-ID: <37043ce6f522a3b0eb12b3f07e94c322@ruby-forum.com>

I did. I've insured that tcl and tk (with development files) are
installed. I verified that the library files are in /usr/lib, and the
include files are in /usr/include/tcl8.4

I then rebuilt ruby with the following commands:
   make clean

Please "rm ext/tk/Makefile".

   ./configure --prefix=/usr/ --with-tcllib=tcl8.4 --with-tklib=tk8.4
        --with-tcl-include =/usr/include/tcl8.4 --with-tcl-lib=/usr/lib
        --with-tk-include=/usr/include/tcl8.4 --with-tk-lib=/usr/lib

Maybe, '--enable-pthread' is required (depend on your Tcl/Tk library).

···

From: Michael Satterwhite <michael@weblore.com>
Subject: Re: tcl interface
Date: Sat, 24 Feb 2007 12:01:50 +0900

   make
   sudo make install

--
                                  Hidetoshi Nagai (nagai@ai.kyutech.ac.jp)

Hidetoshi NAGAI wrote:

Please "rm ext/tk/Makefile".

   ./configure --prefix=/usr/ --with-tcllib=tcl8.4 --with-tklib=tk8.4
        --with-tcl-include =/usr/include/tcl8.4 --with-tcl-lib=/usr/lib
        --with-tk-include=/usr/include/tcl8.4 --with-tk-lib=/usr/lib

Maybe, '--enable-pthread' is required (depend on your Tcl/Tk library).

I did both these, and it now works great. I don't know which fixed it,
but suffice it to say it's fixed.

Just out of curiosity: do you know of any other libraries that are
potential trouble spots?

Regardless - thanks much
---Michael

···

--
Posted via http://www.ruby-forum.com/\.