Ruby 1.8.4 and tcltk under Linux

Discussion in 'Ruby' started by Mark Volkmann, Jan 1, 2006.

  1. 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.

    --
    R. Mark Volkmann
    Partner, Object Computing, Inc.
    Mark Volkmann, Jan 1, 2006
    #1
    1. Advertising

  2. Mark Volkmann

    Guest

    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
    , Jan 1, 2006
    #2
    1. Advertising

  3. 2005/12/31, Mark Volkmann <>:
    > 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-and-tk-on-solaris.html

    Basically:

    # cd ext/tcltklib
    # ruby extconf.rb --with-tcl-include=3D/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=E1rez
    http://santanatechnotes.blogspot.com/
    Gerardo Santana Gómez Garrido, Jan 2, 2006
    #3
  4. On 1/2/06, Mark Volkmann <> wrote:
    > On 1/1/06, Gerardo Santana G=F3mez Garrido <> wr=

    ote:
    > > 2005/12/31, Mark Volkmann <>:
    > > > 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-and-tk-on-solaris.htm=

    l
    > >
    > > Basically:
    > >
    > > # cd ext/tcltklib
    > > # ruby extconf.rb --with-tcl-include=3D/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.
    >


    On my system, ubuntu, the shared library is /usr/lib/libtcl8.4.a, and
    the headers are in /usr/include/tcl8.4
    Jonathan Simms, Jan 2, 2006
    #4
  5. 2006/1/2, Mark Volkmann <>:
    > On 1/1/06, Gerardo Santana G=F3mez Garrido <> wr=

    ote:
    > > 2005/12/31, Mark Volkmann <>:
    > > > 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-and-tk-on-solaris.htm=

    l
    > >
    > > Basically:
    > >
    > > # cd ext/tcltklib
    > > # ruby extconf.rb --with-tcl-include=3D/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.



    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=E1rez
    http://santanatechnotes.blogspot.com/
    Gerardo Santana Gómez Garrido, Jan 2, 2006
    #5
  6. On 1/2/06, Gerardo Santana G=F3mez Garrido <> wrot=
    e:
    > 2006/1/2, Mark Volkmann <>:
    > > On 1/1/06, Gerardo Santana G=F3mez Garrido <> =

    wrote:
    > > > 2005/12/31, Mark Volkmann <>:
    > > > > 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 fo=

    r
    > > > > 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-and-tk-on-solaris.h=

    tml
    > > >
    > > > Basically:
    > > >
    > > > # cd ext/tcltklib
    > > > # ruby extconf.rb --with-tcl-include=3D/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.

    >
    >
    > 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.

    --
    R. Mark Volkmann
    Partner, Object Computing, Inc.
    Mark Volkmann, Jan 3, 2006
    #6
  7. 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=3D/opt/TclTk/tcl8.4.12/generic \
    --with-tk-include=3D/opt/TclTk/tk8.4.12/generic
    4) make
    5) make install
    Mark Volkmann, Jan 3, 2006
    #7
  8. 2006/1/2, Mark Volkmann <>:
    > 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=3D/opt/TclTk/tcl8.4.12/generic \
    > --with-tk-include=3D/opt/TclTk/tk8.4.12/generic
    > 4) make
    > 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.

    --
    Gerardo Santana
    "Between individuals, as between nations, respect for the rights of
    others is peace" - Don Benito Ju=E1rez
    http://santanatechnotes.blogspot.com/
    Gerardo Santana Gómez Garrido, Jan 3, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Helmut Jarausch
    Replies:
    0
    Views:
    424
    Helmut Jarausch
    Jul 17, 2003
  2. Grzegorz Dostatni

    cygwin tcltk 8.3

    Grzegorz Dostatni, Nov 29, 2003, in forum: Python
    Replies:
    1
    Views:
    344
    Jason Tishler
    Dec 2, 2003
  3. ab
    Replies:
    1
    Views:
    307
    Jeff Epler
    May 17, 2005
  4. Chris
    Replies:
    0
    Views:
    249
    Chris
    Sep 11, 2008
  5. Mike
    Replies:
    0
    Views:
    90
Loading...

Share This Page