How can I determine if I have Tk installed?
I have a Tk.rb in the folder /home/christopherl/ruby-1.8.5/ext/tk/lib.
Here are some folders I have:
home/christopherl/ruby-1.8.5/ext/tk
/home/christopherl/ruby-1.8.5/ext/tk/lib
/home/christopherl/ruby-1.8.5/ext/tk/lib/tk
/home/christopherl/ruby-1.8.5/ext/tk/lib/tkextlib
/home/christopherl/ruby-1.8.5/ext/tk/sample
/home/christopherl/ruby-1.8.5/ext/tk/tkutil
That’s actually not Tk, but Ruby’s Tk binding for Tk, which needs the
actual Tk library in order to be compiled.
Tk usually comes together with Tcl, a scripting language that was the
first to bundle Tk, so a good way to find out whether you have the
Tcl/Tk pair at all is:
which tclsh
In my openSuse 10.1 box I found libtk to be at:
/usr/lib/libtk8.4.so
but that alone is not enough, you also need to have the C header
files, most probably somewhere inside /usr/include
this is so the ruby build process can build the Tk extension binary
linked against the shared library, so both the Tk header (.h) and the
binary (.so) are needed.
If you find out you don’t have Tk installed, or only one of the needed
pieces, you will need to install the part you’re missing.
If you use Debian or a Debian based distro like
Ubuntu: Debian -- Error
so you can:
apt-get install tk8.4
apt-get install tk8.4-dev
I think Redhat, Suse and Fedora come with Tk by default, but if you
are missing them for some reason, you can install what you need using
Yast, Yum, or apt for RPM.
Of course, the remaining option is building and installing Tcl/tk from
source, just as you’re doing with Ruby. Source available at:
http://www.tcl.tk (neat TLD by the way)
Hope that helps,
UG
Uma G.