Forum: Ruby Ruby 1.8.4 and tcltk under Linux

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
52a177e9dbd3e614825aabc4e45f8cd6?d=identicon&s=25 Mark Volkmann (Guest)
on 2006-01-01 03:24
(Received via mailing list)
I have some Ruby code that uses Tk that works fine under Windows.
However, when I try to run it under Linux with Ruby 1.8.4 installed I
get "no such file to load -- tcltklib".

Do I have to take steps to install tcltk? I don't recall having to do
that under Windows, but perhaps the one-click installer did that for
me. If I need to do this, a pointer to a web page that explains how
would be much appreciated.
E24dee41b2fcaff084d11bb928dba23d?d=identicon&s=25 unknown (Guest)
on 2006-01-01 04:24
(Received via mailing list)
Mark Volkmann wrote:
> I have some Ruby code that uses Tk that works fine under Windows.
> However, when I try to run it under Linux with Ruby 1.8.4 installed I
> get "no such file to load -- tcltklib".

ruby does not replace tcl or tk.  It requires the underlying libraries
provided
by those packages.

> Do I have to take steps to install tcltk?

Yes.  see ruby-1.8.4/ext/tk/README.tcltklib

I don't recall having to do
> that under Windows

perhaps has a library/dll

best regards,
Gerald
5a601582df3b42b65a5e8353fc9305da?d=identicon&s=25 =?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?= (Guest)
on 2006-01-02 04:10
(Received via mailing list)
2005/12/31, Mark Volkmann <r.mark.volkmann@gmail.com>:
> I have some Ruby code that uses Tk that works fine under Windows.
> However, when I try to run it under Linux with Ruby 1.8.4 installed I
> get "no such file to load -- tcltklib".
>
> Do I have to take steps to install tcltk? I don't recall having to do
> that under Windows, but perhaps the one-click installer did that for
> me. If I need to do this, a pointer to a web page that explains how
> would be much appreciated.

I had the same problem. Hard to find a solution on the web, until I
look into my own ruby source tree:

http://santanatechnotes.blogspot.com/2005/12/ruby-...

Basically:

# cd ext/tcltklib
# ruby extconf.rb --with-tcl-include=/usr/sfw/include
# make && make install

That was for Solaris, but will work on Linux (just change the path to
your Tcl/Tk headers and libraries). Don't forget to read the README
file.


>
> --
> R. Mark Volkmann
> Partner, Object Computing, Inc.
>
>


--
Gerardo Santana
"Between individuals, as between nations, respect for the rights of
others is peace" - Don Benito Juárez
http://santanatechnotes.blogspot.com/
52a177e9dbd3e614825aabc4e45f8cd6?d=identicon&s=25 Mark Volkmann (Guest)
on 2006-01-02 17:15
(Received via mailing list)
On 1/1/06, Gerardo Santana Gómez Garrido <gerardo.santana@gmail.com> wrote:
> I had the same problem. Hard to find a solution on the web, until I
> look into my own ruby source tree:
>
> http://santanatechnotes.blogspot.com/2005/12/ruby-...
>
> Basically:
>
> # cd ext/tcltklib
> # ruby extconf.rb --with-tcl-include=/usr/sfw/include

This command runs without error, but I don't have a /usr/sfw directory.

> # make && make install

This command says "Nothing to be done for 'all'".

> That was for Solaris, but will work on Linux (just change the path to
> your Tcl/Tk headers and libraries). Don't forget to read the README
> file.

This seems to be the root of my problem. I don't know where the Tcl/Tk
headers and libraries are located on my machine. Can you tell me the
name of one of the files so I can search for it? I tried running "find
. -name '*tcltk*' -print" from / and didn't find any libraries.
46b52bcfe95ed4cf26054814f6b3bc37?d=identicon&s=25 Jonathan Simms (Guest)
on 2006-01-02 17:28
(Received via mailing list)
On 1/2/06, Mark Volkmann <r.mark.volkmann@gmail.com> wrote:
> >
> This command runs without error, but I don't have a /usr/sfw directory.
> headers and libraries are located on my machine. Can you tell me the
> name of one of the files so I can search for it? I tried running "find
> . -name '*tcltk*' -print" from / and didn't find any libraries.
>

On my system, ubuntu, the shared library is /usr/lib/libtcl8.4.a, and
the headers are in /usr/include/tcl8.4
5a601582df3b42b65a5e8353fc9305da?d=identicon&s=25 =?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?= (Guest)
on 2006-01-02 17:34
(Received via mailing list)
2006/1/2, Mark Volkmann <r.mark.volkmann@gmail.com>:
> >
> This command runs without error, but I don't have a /usr/sfw directory.
> headers and libraries are located on my machine. Can you tell me the
> name of one of the files so I can search for it? I tried running "find
> . -name '*tcltk*' -print" from / and didn't find any libraries.


At then end of the output of extconf.rb says it couldn't find some
files. One of them in tcl.h, look for it.

--
Gerardo Santana
"Between individuals, as between nations, respect for the rights of
others is peace" - Don Benito Juárez
http://santanatechnotes.blogspot.com/
52a177e9dbd3e614825aabc4e45f8cd6?d=identicon&s=25 Mark Volkmann (Guest)
on 2006-01-03 02:44
(Received via mailing list)
On 1/2/06, Gerardo Santana Gómez Garrido <gerardo.santana@gmail.com> wrote:
> > > > would be much appreciated.
> >
> > This seems to be the root of my problem. I don't know where the Tcl/Tk
> > headers and libraries are located on my machine. Can you tell me the
> > name of one of the files so I can search for it? I tried running "find
> > . -name '*tcltk*' -print" from / and didn't find any libraries.
>
>
> At then end of the output of extconf.rb says it couldn't find some
> files. One of them in tcl.h, look for it.

My Fedora Core 4 system doesn't have tcl.h anywhere, but I do have
libtcl8.4.so in /usr/lib.
52a177e9dbd3e614825aabc4e45f8cd6?d=identicon&s=25 Mark Volkmann (Guest)
on 2006-01-03 02:59
(Received via mailing list)
Got it!  Here's what I had to do.

1) Download tcl8.4.12-src.tar.gz and tk8.4.12-src.tar.gz
http://www.tcl.tk/software/tcltk/downloadnow84.html
2) Unzip and untar them into /opt/TclTk.
3) ruby extconf.rb \
    --with-tcl-include=/opt/TclTk/tcl8.4.12/generic \
    --with-tk-include=/opt/TclTk/tk8.4.12/generic
4) make
5) make install
5a601582df3b42b65a5e8353fc9305da?d=identicon&s=25 =?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?= (Guest)
on 2006-01-03 03:24
(Received via mailing list)
2006/1/2, Mark Volkmann <r.mark.volkmann@gmail.com>:
>
>

Extracting the sources you get the header files, yes, but not the
libraries. But still your post implies that somehow extconf.rb found
the libraries, otherwise you wouldn't be able to build the tcltklib
extension.

I suppose your Linux distribution has the Tcl/Tk libraries already
installed but not the header files. These header files are located in
a so called development package or -devel I think.

--
Gerardo Santana
"Between individuals, as between nations, respect for the rights of
others is peace" - Don Benito Juárez
http://santanatechnotes.blogspot.com/
52a177e9dbd3e614825aabc4e45f8cd6?d=identicon&s=25 Mark Volkmann (Guest)
on 2006-01-03 03:33
(Received via mailing list)
On 1/2/06, Gerardo Santana Gómez Garrido <gerardo.santana@gmail.com> wrote:
> > 5) make install
> Extracting the sources you get the header files, yes, but not the
> libraries. But still your post implies that somehow extconf.rb found
> the libraries, otherwise you wouldn't be able to build the tcltklib
> extension.
>
> I suppose your Linux distribution has the Tcl/Tk libraries already
> installed but not the header files. These header files are located in
> a so called development package or -devel I think.

That's right. I had the libraries, but not the header files. Maybe
this is peculiar to Fedora Core 4, or perhaps just peculiar to my
installation.
This topic is locked and can not be replied to.