Installing tk interface to ruby on RH9.0 GNU/LINUX


(Himanshu Garg) #1

Hello,
I installed ruby 1.8.1 and it works fine. I also installed tk8.4 and
tcl8.4 in /usr/local/ and they work fine too. However when I try to
install the ruby extensions I get errors.

/usr/local/lib/ruby/site_ruby/1.8/i686-linux/tcltklib.so: libtk8.4.so:
cannot open shared object file: No such file or directory -
/usr/local/lib/ruby/site_ruby/1.8/i686-linux/tcltklib.so (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/tk.rb:7
from demo/lines1.rb:3:in `require’
from demo/lines1.rb:3

Could you suggest what's wrong. The detailed command sequence for

installation is given in the end of this mail.

Thank You,
Himanshu.

P.S.
I start with extconf.rb as follows:-

[root@Himanshu-tcltklib]#CONFIGURE_ARGS=’–with-tcl-include=/usr/local/include/ --with-tk-include=/usr/local/include --with-tcl-lib=/usr/local/lib/ --with-tk-lib=/usr/local/lib/ --enable-tcltk_stubs --with-tcllib=tcl8.4 --with-tklib=tk8.4’ ruby extconf.rb
checking for t_open() in -lnsl… no
checking for socket() in -lsocket… no
checking for dlopen() in -ldl… yes
checking for log() in -lm… yes
checking for tcl.h… yes
checking for tk.h… yes
checking for XOpenDisplay() in -lX11… yes
checking for Tcl_InitStubs() in -ltcl8.4… yes
checking for Tk_InitStubs() in -ltk8.4… yes
creating Makefile

[root@Himanshu tcltklib]# make
make: Nothing to be done for `all’.

[root@Himanshu tcltklib]# make install
install -c -p -m 0755 tcltklib.so
/usr/local/lib/ruby/site_ruby/1.8/i686-linux
install -c -p -m 0644 ./lib/tcltk.rb /usr/local/lib/ruby/site_ruby/1.8

[root@Himanshu tcltklib]# ruby demo/
lines0.tcl lines1.rb lines2.rb safeTk.rb

[root@Himanshu tcltklib]# ruby demo/lines1.rb
/usr/local/lib/ruby/site_ruby/1.8/i686-linux/tcltklib.so: libtk8.4.so:
cannot open shared object file: No such file or directory -
/usr/local/lib/ruby/site_ruby/1.8/i686-linux/tcltklib.so (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/tk.rb:7
from demo/lines1.rb:3:in `require’
from demo/lines1.rb:3

[root@Himanshu tcltklib]#


(ts) #2

/usr/local/lib/ruby/site_ruby/1.8/i686-linux/tcltklib.so: libtk8.4.so:
cannot open shared object file: No such file or directory -

It's trying to say that at runtime, it can't find libtk8.4.so

This means that the directory where is located libtk8.4.so (probably
/usr/local/lib) is not in /etc/ld.so.conf nor in the environmental
variable LD_LIBRARY_PATH

Guy Decoux


(Himanshu Garg) #3

Thanks a lot for the surprisingly prompt and absolutely
correct response. I added the entry to /etc/ld.so.conf and ran ldconfig
and everything works fine.

Thank You,
Himanshu.

···

On Fri, 2004-02-13 at 18:15, ts wrote:

/usr/local/lib/ruby/site_ruby/1.8/i686-linux/tcltklib.so: libtk8.4.so:
cannot open shared object file: No such file or directory -

It’s trying to say that at runtime, it can’t find libtk8.4.so

This means that the directory where is located libtk8.4.so (probably
/usr/local/lib) is not in /etc/ld.so.conf nor in the environmental
variable LD_LIBRARY_PATH

Guy Decoux