LoadError: no such file to load -- tk

Discussion in 'Ruby' started by Rich Leblanc, Jul 19, 2010.

  1. Rich Leblanc

    Rich Leblanc Guest

    I'm trying to install Ruby on a 64 bit Windows 7 machine following this
    guide;

    http://www.tkdocs.com/tutorial/install.html#installwin

    After setting the environment variables and compiling I get this error:

    >irb

    irb(main):001:0> require 'tk'
    LoadError: no such file to load -- tk
    from (irb):1:in `require'
    from (irb):1
    from :0


    I've googled for an answer but only find lot's of other people with the
    same problem but no answer. Any ideas why it doesn't work or how to fix
    it?
    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 19, 2010
    #1
    1. Advertising

  2. Rich Leblanc

    Roger Pack Guest

    Roger Pack, Jul 19, 2010
    #2
    1. Advertising

  3. Rich Leblanc

    Rich Leblanc Guest

    Rich Leblanc, Jul 19, 2010
    #3
  4. On Mon, Jul 19, 2010 at 3:26 PM, Rich Leblanc <> wrote:
    > Roger Pack wrote:
    >> This means your ruby was built without the tk extension built.
    >>
    >> Useful refs:
    >> http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk
    >> http://wiki.github.com/rdp/ruby_tutorials_core/tk (availability).
    >> Cheers.
    >> -r

    >
    > Yes I know, but why not? Neither of those links was helpful.


    How did you install Ruby? Using RubyInstaller? That doesn't include Tk
    (because, as I understand it, it's currently impossible to
    automatically build and package Tk along with it).

    Assuming you installed Tk, you can compile a gem called tk_as_gem that
    will work with your existing Tk installation. You'll need the Ruby
    development kit (MSys tools, available from http://rubyinstaller.org/)
    to compile it.
    Eric Christopherson, Jul 20, 2010
    #4
  5. Rich Leblanc

    Rich Leblanc Guest

    Eric Christopherson wrote:
    > On Mon, Jul 19, 2010 at 3:26 PM, Rich Leblanc <> wrote:
    >> Roger Pack wrote:
    >>> This means your ruby was built without the tk extension built.
    >>>
    >>> Useful refs:
    >>> http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk
    >>> http://wiki.github.com/rdp/ruby_tutorials_core/tk (availability).
    >>> Cheers.
    >>> -r

    >>
    >> Yes I know, but why not? Neither of those links was helpful.

    >
    > How did you install Ruby? Using RubyInstaller? That doesn't include Tk
    > (because, as I understand it, it's currently impossible to
    > automatically build and package Tk along with it).
    >
    > Assuming you installed Tk, you can compile a gem called tk_as_gem that
    > will work with your existing Tk installation. You'll need the Ruby
    > development kit (MSys tools, available from http://rubyinstaller.org/)
    > to compile it.


    Like the first post says;

    I'm trying to install Ruby on a 64 bit Windows 7 machine following this
    guide;

    http://www.tkdocs.com/tutorial/install.html#installwin


    I installed ActiveState ActiveTCL which includes tk. I can run wish85
    successfully. Tcl/tk is installed.

    Like the first post says, after setting environment variables and
    compiling according to the instructions it doesn't work. And by that I
    mean that when I run require 'tk' from the irb it gives the error
    message;

    LoadError: no such file to load -- tk

    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 20, 2010
    #5
  6. Rich Leblanc

    Rich Leblanc Guest

    Rich Leblanc wrote:
    > Eric Christopherson wrote:
    >> On Mon, Jul 19, 2010 at 3:26 PM, Rich Leblanc <> wrote:
    >>> Roger Pack wrote:
    >>>> This means your ruby was built without the tk extension built.
    >>>>
    >>>> Useful refs:
    >>>> http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk
    >>>> http://wiki.github.com/rdp/ruby_tutorials_core/tk (availability).
    >>>> Cheers.
    >>>> -r
    >>>
    >>> Yes I know, but why not? Neither of those links was helpful.

    >>
    >> How did you install Ruby? Using RubyInstaller? That doesn't include Tk
    >> (because, as I understand it, it's currently impossible to
    >> automatically build and package Tk along with it).
    >>
    >> Assuming you installed Tk, you can compile a gem called tk_as_gem that
    >> will work with your existing Tk installation. You'll need the Ruby
    >> development kit (MSys tools, available from http://rubyinstaller.org/)
    >> to compile it.

    >
    > Like the first post says;
    >
    > I'm trying to install Ruby on a 64 bit Windows 7 machine following this
    > guide;
    >
    > http://www.tkdocs.com/tutorial/install.html#installwin
    >
    >
    > I installed ActiveState ActiveTCL which includes tk. I can run wish85
    > successfully. Tcl/tk is installed.
    >
    > Like the first post says, after setting environment variables and
    > compiling according to the instructions it doesn't work. And by that I
    > mean that when I run require 'tk' from the irb it gives the error
    > message;
    >
    > LoadError: no such file to load -- tk


    I'm not using rubyinstaller. I'm compiling from source.

    >> Assuming you installed Tk, you can compile a gem called tk_as_gem that
    >> will work with your existing Tk installation. You'll need the Ruby
    >> development kit (MSys tools, available from http://rubyinstaller.org/)
    >> to compile it.



    I don't understand what any of that means or why I'd want to do it. I'm
    just a newb trying to learn ruby but can't get it to install with tk
    following that tutorial.

    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 20, 2010
    #6
  7. Rich Leblanc

    Roger Pack Guest


    > LoadError: no such file to load -- tk


    This means that your Ruby runtime, when you built it, was unable to find
    your Tk libs/headers, so didn't build your Tk installation.

    Your only hope after that point is to somehow make them accessible (in
    your case, by building Tcl/Tk using the same compiler you used to build
    ruby, then installing tk_as_gem).

    recommendation: use rubyinstaller, then research the links I gave you,
    which point eventually to either using tk_as_gem+devkit or this helper.

    Also ffi-tk might fit the bill.

    The rubyinstaller guys hope to make it easier to get to tk in the
    future.
    -r
    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Jul 20, 2010
    #7
  8. Rich Leblanc

    Rich Leblanc Guest

    Roger Pack wrote:
    >
    >> LoadError: no such file to load -- tk

    >
    > This means that your Ruby runtime, when you built it, was unable to find
    > your Tk libs/headers, so didn't build your Tk installation.
    >


    Yes I got that much. But I don't understand why. I followed that guide
    step by step but it didn't work.


    > Your only hope after that point is to somehow make them accessible (in
    > your case, by building Tcl/Tk using the same compiler you used to build
    > ruby, then installing tk_as_gem).


    My only hope? What about figuring out why it didn't work, fix the
    problem and try again? That tutorial obviously works for some people.


    >
    > recommendation: use rubyinstaller, then research the links I gave you,
    > which point eventually to either using tk_as_gem+devkit or this helper.
    >


    The tutorial says do not use the installer. I'd like to get one thing
    working before moving on to something else I don't understand. I didn't
    find anything helpful in those links. If you'd like to link the specific
    page that points to the answer to my problem I'd be happy to read it.



    > Also ffi-tk might fit the bill.
    >
    > The rubyinstaller guys hope to make it easier to get to tk in the
    > future.
    > -r


    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 20, 2010
    #8
  9. Rich Leblanc

    Roger Pack Guest

    Rich Leblanc wrote:
    > Roger Pack wrote:
    >>
    >>> LoadError: no such file to load -- tk

    >>
    >> This means that your Ruby runtime, when you built it, was unable to find
    >> your Tk libs/headers, so didn't build your Tk installation.
    >>

    >
    > Yes I got that much. But I don't understand why. I followed that guide
    > step by step but it didn't work.


    1.9.1 didn't build the Tk extension all that well on windows. It should
    be fixed with 1.9.2...or there may be some other bug since I only use
    mingw not VC to compile it.

    To reproduce it go into your ext/tk library and run extconf.rb (and
    nmake I guess). It should fail.

    >> Your only hope after that point is to somehow make them accessible (in
    >> your case, by building Tcl/Tk using the same compiler you used to build
    >> ruby, then installing tk_as_gem).

    >
    > My only hope? What about figuring out why it didn't work, fix the
    > problem and try again?


    Please do.

    > The tutorial says do not use the installer. I'd like to get one thing
    > working before moving on to something else I don't understand. I didn't
    > find anything helpful in those links. If you'd like to link the specific
    > page that points to the answer to my problem I'd be happy to read it.


    The tutorial contains instructions on how to build it from source...

    >> Also ffi-tk might fit the bill.


    Do you have any response to this (it's a gem)?

    Anyway, to make it easier I packaged up one for you.
    I downloaded 1.9.1p429 from http://rubyinstaller.org/downloads/
    then downloaded "â—¦Ruby/Tk environment" from from
    http://www.ruby-forum.com/topic/210186#new
    and unpackaged it to the appropriate directory.

    http://faithpromotingrumors.org/incoming/ruby-1.9.1-p429-i386-mingw32.7z

    GL.
    -r
    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Jul 20, 2010
    #9
  10. Rich Leblanc

    Rich Leblanc Guest

    Roger Pack wrote:
    > Rich Leblanc wrote:
    >> Roger Pack wrote:
    >>>
    >>>> LoadError: no such file to load -- tk
    >>>
    >>> This means that your Ruby runtime, when you built it, was unable to find
    >>> your Tk libs/headers, so didn't build your Tk installation.
    >>>

    >>
    >> Yes I got that much. But I don't understand why. I followed that guide
    >> step by step but it didn't work.

    >
    > 1.9.1 didn't build the Tk extension all that well on windows. It should
    > be fixed with 1.9.2...or there may be some other bug since I only use
    > mingw not VC to compile it.
    >


    The tutorial says use 1.8.x not 1.9.x.


    > To reproduce it go into your ext/tk library and run extconf.rb (and
    > nmake I guess). It should fail.
    >


    Reproduce what? I don't understand.

    >>> Your only hope after that point is to somehow make them accessible (in
    >>> your case, by building Tcl/Tk using the same compiler you used to build
    >>> ruby, then installing tk_as_gem).

    >>
    >> My only hope? What about figuring out why it didn't work, fix the
    >> problem and try again?

    >
    > Please do.



    I'm trying. That's why I'm here. It seems that tk library is not in the
    right place when compiling. Is that it? Then where should it be so I can
    check and see if it's there?



    >
    >> The tutorial says do not use the installer. I'd like to get one thing
    >> working before moving on to something else I don't understand. I didn't
    >> find anything helpful in those links. If you'd like to link the specific
    >> page that points to the answer to my problem I'd be happy to read it.

    >
    > The tutorial contains instructions on how to build it from source...


    Uh, ya.

    >
    >>> Also ffi-tk might fit the bill.

    >
    > Do you have any response to this (it's a gem)?


    I don't know what that is or what a gem is. I'm a newb at the beginning
    trying to follow a tutorial. I know very little about ruby.


    >
    > Anyway, to make it easier I packaged up one for you.
    > I downloaded 1.9.1p429 from http://rubyinstaller.org/downloads/
    > then downloaded "â—¦Ruby/Tk environment" from from
    > http://www.ruby-forum.com/topic/210186#new
    > and unpackaged it to the appropriate directory.
    >
    > http://faithpromotingrumors.org/incoming/ruby-1.9.1-p429-i386-mingw32.7z
    >
    > GL.
    > -r


    don't know what any of that means.
    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 20, 2010
    #10
  11. From: Rich Leblanc <>
    Subject: Re: LoadError: no such file to load -- tk
    Date: Wed, 21 Jul 2010 03:50:10 +0900
    Message-ID: <>
    > > To reproduce it go into your ext/tk library and run extconf.rb (and
    > > nmake I guess). It should fail.

    >
    > Reproduce what? I don't understand.


    ext/tk/extconf.rb creates Makefile for tcltklilb.so (core library of
    Ruby/Tk), when it finds Tcl/Tk libraries (see ext/tk/README.tcltklib).
    If it fails to find proper Tcl/Tk libraries, it creates a dummy
    Makefile (it can make nothing). So, before retrying to configure
    (run ext/tk/extconf.rb), please remove such dummy Makefile.

    If ext/tk/extconf.rb cannot create an available Makefile although you
    give the paths of Tcl/Tk libraries, please check consistency of
    architecture between Ruby and Tcl/Tk.
    When 32bit <=> 64bit or 64bit <=> 32bit, probably ext/tk/extconf.rb
    doesn't select the Tcl/Tk libraries to make tcltklib.so.
    --
    Hidetoshi NAGAI ()
    Department of Artificial Intelligence, Kyushu Institute of Technology
    Hidetoshi NAGAI, Jul 20, 2010
    #11
  12. Rich Leblanc

    Roger Pack Guest


    >> 1.9.1 didn't build the Tk extension all that well on windows. It should
    >> be fixed with 1.9.2...or there may be some other bug since I only use
    >> mingw not VC to compile it.
    >>

    >
    > The tutorial says use 1.8.x not 1.9.x.


    If you're interested in a 1.8.x that works with tk, see
    http://rubyinstaller.org/downloads/
    "Ruby 1.8.6-p27 (RC2)"

    Install that, and activeState 8.5 in your path and it should "just work"
    >> To reproduce it go into your ext/tk library and run extconf.rb (and
    >> nmake I guess). It should fail.
    >>

    >
    > Reproduce what? I don't understand.


    Reproduce ruby not "finding" Tk to compile it in.

    > I'm trying. That's why I'm here. It seems that tk library is not in the
    > right place when compiling. Is that it?


    I think so.

    > Then where should it be so I can
    > check and see if it's there?


    I'm not sure I've never built it using mswin.

    If you want to build it with mingw checkout the tcl branch of
    rubyinstaller:
    http://github.com/oneclick/rubyinstaller/tree/tcl


    if you run a rake from there
    (rake ruby18)
    it should build ruby with the tk extension built.

    >> Do you have any response to this (it's a gem)?


    Typically when you're just starting ruby on windows, it's recommended to
    use a pre-built package instead of building it yourself.

    gem is ruby's way of distributing libraries easily. google for rubygems.
    Cheers!
    -rp
    >> http://faithpromotingrumors.org/incoming/ruby-1.9.1-p429-i386-mingw32.7z



    If you unpack that zip file (download 7 zip to be able to extract it),
    you'll get a full fledged ruby 1.9.1 with the Tk extension already
    built.

    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Jul 20, 2010
    #12
  13. Rich Leblanc

    Rich Leblanc Guest

    Hidetoshi NAGAI wrote:
    > From: Rich Leblanc <>
    > Subject: Re: LoadError: no such file to load -- tk
    > Date: Wed, 21 Jul 2010 03:50:10 +0900
    > Message-ID: <>
    >> > To reproduce it go into your ext/tk library and run extconf.rb (and
    >> > nmake I guess). It should fail.

    >>
    >> Reproduce what? I don't understand.

    >
    > ext/tk/extconf.rb creates Makefile for tcltklilb.so (core library of
    > Ruby/Tk), when it finds Tcl/Tk libraries (see ext/tk/README.tcltklib).
    > If it fails to find proper Tcl/Tk libraries, it creates a dummy
    > Makefile (it can make nothing). So, before retrying to configure
    > (run ext/tk/extconf.rb), please remove such dummy Makefile.
    >


    By dummy Makefile do you mean an empty one? There is a Makefile but
    there is stuff in it. I deleted it and tried to recompile but now having
    problems with the Microsoft tools this tutorial wants me to use.


    > If ext/tk/extconf.rb cannot create an available Makefile although you
    > give the paths of Tcl/Tk libraries, please check consistency of
    > architecture between Ruby and Tcl/Tk.
    > When 32bit <=> 64bit or 64bit <=> 32bit, probably ext/tk/extconf.rb
    > doesn't select the Tcl/Tk libraries to make tcltklib.so.


    This is getting more and more confusing. How do I check check
    consistency of architecture between Ruby and Tcl/Tk if it's 32 bit or
    64? I thought 32 bit apps can run on a 64 bit machine. This tutorial is
    really awful. It gives me nothing but problems every step of the way. Is
    there some better way to learn Ruby/tk? And why does he want me to use
    1.8.x and not 1.9.x?




    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 21, 2010
    #13
  14. Rich Leblanc

    Roger Pack Guest


    > This is getting more and more confusing. How do I check check
    > consistency of architecture between Ruby and Tcl/Tk if it's 32 bit or
    > 64? I thought 32 bit apps can run on a 64 bit machine. This tutorial is
    > really awful. It gives me nothing but problems every step of the way. Is
    > there some better way to learn Ruby/tk? And why does he want me to use
    > 1.8.x and not 1.9.x?


    You can use either one.
    You probably can only mix 32 bit ruby with 32 bit Tcl/Tk distro.

    Re: easier
    did you see my comment about ""Ruby 1.8.6-p27 (RC2)""
    or about a zip file that contains tk?

    Re: learning it:
    http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk
    may be of some use to you.
    GL!
    -r
    --
    Posted via http://www.ruby-forum.com/.
    Roger Pack, Jul 21, 2010
    #14
  15. Rich Leblanc

    Rich Leblanc Guest

    Roger Pack wrote:
    >
    >> This is getting more and more confusing. How do I check check
    >> consistency of architecture between Ruby and Tcl/Tk if it's 32 bit or
    >> 64? I thought 32 bit apps can run on a 64 bit machine. This tutorial is
    >> really awful. It gives me nothing but problems every step of the way. Is
    >> there some better way to learn Ruby/tk? And why does he want me to use
    >> 1.8.x and not 1.9.x?

    >
    > You can use either one.
    > You probably can only mix 32 bit ruby with 32 bit Tcl/Tk distro.
    >
    > Re: easier
    > did you see my comment about ""Ruby 1.8.6-p27 (RC2)""


    What comment? I've read everything in this thread. You mean the one that
    says; "If you're interested in a 1.8.x that works with tk, see
    http://rubyinstaller.org/downloads/"

    I don't really want to use 1.8.x, that stupid tutorial told me to. Of
    course I'd like to use the latest and greatest which is probably 1.9.x.


    > or about a zip file that contains tk?


    You mean this one you made?
    http://faithpromotingrumors.org/incoming/ruby-1.9.1-p429-i386-mingw32.7z

    I'm installing 7 zip now to try it. I didn't want to use 1.9.x because
    that tutorial told me to specifically compile the 1.8.x source but since
    that tutorial was a total disaster I'm looking at using your 1.9.x and
    that new tutorial below. The tutorial is nice but doesn't say how to
    install ruby. Just about programming in the language. I need to get it
    installed first and that is the hard part. You can compile from source
    or use a "one click install" on windows. I'd rather compile from source
    but can't get it to work. I also have a FreeBSD Unix machine that I can
    use too but don't see any other tutorials about how to install ruby/tk
    on that. I have no idea how to do it on Unix so I'm trying on windows
    first. Actually, I did install ruby and Tcl/tk on my Unix box but
    getting the same error. I need to know where to put the libraries and
    how to get it to work.

    >
    > Re: learning it:
    > http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk
    > may be of some use to you.
    > GL!
    > -r


    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 21, 2010
    #15
  16. Rich Leblanc

    Rich Leblanc Guest

    Rich Leblanc wrote:
    > Roger Pack wrote:
    >> Rich Leblanc wrote:
    >>> Roger Pack wrote:
    >>>>
    >>>>> LoadError: no such file to load -- tk
    >>>>
    >>>> This means that your Ruby runtime, when you built it, was unable to find
    >>>> your Tk libs/headers, so didn't build your Tk installation.
    >>>>
    >>>
    >>> Yes I got that much. But I don't understand why. I followed that guide
    >>> step by step but it didn't work.

    >>
    >> 1.9.1 didn't build the Tk extension all that well on windows. It should
    >> be fixed with 1.9.2...or there may be some other bug since I only use
    >> mingw not VC to compile it.
    >>

    >
    > The tutorial says use 1.8.x not 1.9.x.
    >
    >
    >> To reproduce it go into your ext/tk library and run extconf.rb (and
    >> nmake I guess). It should fail.
    >>

    >
    > Reproduce what? I don't understand.
    >
    >>>> Your only hope after that point is to somehow make them accessible (in
    >>>> your case, by building Tcl/Tk using the same compiler you used to build
    >>>> ruby, then installing tk_as_gem).
    >>>
    >>> My only hope? What about figuring out why it didn't work, fix the
    >>> problem and try again?

    >>
    >> Please do.

    >
    >
    > I'm trying. That's why I'm here. It seems that tk library is not in the
    > right place when compiling. Is that it? Then where should it be so I can
    > check and see if it's there?
    >
    >
    >
    >>
    >>> The tutorial says do not use the installer. I'd like to get one thing
    >>> working before moving on to something else I don't understand. I didn't
    >>> find anything helpful in those links. If you'd like to link the specific
    >>> page that points to the answer to my problem I'd be happy to read it.

    >>
    >> The tutorial contains instructions on how to build it from source...

    >
    > Uh, ya.
    >
    >>
    >>>> Also ffi-tk might fit the bill.

    >>
    >> Do you have any response to this (it's a gem)?

    >
    > I don't know what that is or what a gem is. I'm a newb at the beginning
    > trying to follow a tutorial. I know very little about ruby.
    >
    >
    >>
    >> Anyway, to make it easier I packaged up one for you.
    >> I downloaded 1.9.1p429 from http://rubyinstaller.org/downloads/
    >> then downloaded "â—¦Ruby/Tk environment" from from
    >> http://www.ruby-forum.com/topic/210186#new
    >> and unpackaged it to the appropriate directory.
    >>
    >> http://faithpromotingrumors.org/incoming/ruby-1.9.1-p429-i386-mingw32.7z
    >>
    >> GL.
    >> -r

    >
    > don't know what any of that means.


    Ok I've unzipped this thing now how do I install it? And what would I do
    if you didn't make me this? I'd really like to get the original problem
    fixed and figure out how to get the 1.8.x source compiled and working as
    in that tutorial. I'd like to know how to get the proper files in the
    right place and understand what I'm doing not "click one button and have
    it magically work".

    I don't want to start getting sidetracked. How can I build the 1.8.x
    source properly with tk and avoid this error? That was my original
    question. I also need to get this working on my Unix machine next (or in
    parallel). As far as I know there is no "one-click installer" for that.
    I need to know what goes where. Aren't there any install instructions
    anywhere?

    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 21, 2010
    #16
  17. From: Rich Leblanc <>
    Subject: Re: LoadError: no such file to load -- tk
    Date: Wed, 21 Jul 2010 11:16:27 +0900
    Message-ID: <>
    > This is getting more and more confusing. How do I check check
    > consistency of architecture between Ruby and Tcl/Tk if it's 32 bit or
    > 64? I thought 32 bit apps can run on a 64 bit machine. This tutorial is


    # Because I'm not familiar with development on Windows, the following
    # may be wrong.

    On Ruby/Tk, Ruby links tcltklib.so and links dynamic link librariies
    of Tcl/Tk. If Ruby's core is a 32bit binary and Tcl/Tk DLLs are 64bit
    binaries, Ruby cannot link Tcl/Tk DLLs.
    It's not about OS, but consistency between an executable and DLLs.

    Which version of ActiveTcl did you download?
    If its platform is "Windows (x86)", it is 32bit version of Tcl/Tk.
    But if you download "Windows (64-bit, x64)", then 64bit.

    How does "ruby.exe -v" describe?
    If it includes "x86-mswin32", then it is a 32bit executable.
    Else if includes "x64-mswin64", then a 64bit.

    If your Tcl/Tk is 64bit and your compiler can make 64bit binaries,
    please try "--target=x64-mswin64" configure option.
    If your compiler can make 32bit binaries only, please download and
    install a 32bit version of ActiveTcl.
    --
    Hidetoshi NAGAI ()
    Department of Artificial Intelligence, Kyushu Institute of Technology
    Hidetoshi NAGAI, Jul 21, 2010
    #17
  18. Rich Leblanc

    Rich Leblanc Guest

    Actually I would like to get this fixed on my Unix machine too. I'm
    getting this same error. I have tcl8.5.8 installed and Ruby 1.8.7. How
    can I get it to work on Unix? Maybe if I get that working I'll
    understand what I'm supposed to do on Windows.
    --
    Posted via http://www.ruby-forum.com/.
    Rich Leblanc, Jul 21, 2010
    #18
  19. On Wed, Jul 21, 2010 at 1:27 PM, Rich Leblanc <> wrote:
    > Rich Leblanc wrote:
    >> Roger Pack wrote:
    >>> Rich Leblanc wrote:
    >>>> Roger Pack wrote:
    >>>>>
    >>>>>> LoadError: no such file to load -- tk
    >>>>>
    >>>>> This means that your Ruby runtime, when you built it, was unable to f=

    ind
    >>>>> your Tk libs/headers, so didn't build your Tk installation.
    >>>>>
    >>>>
    >>>> Yes I got that much. But I don't understand why. I followed that guide
    >>>> step by step but it didn't work.
    >>>
    >>> 1.9.1 didn't build the Tk extension all that well on windows. =C2=A0It =

    should
    >>> be fixed with 1.9.2...or there may be some other bug since I only use
    >>> mingw not VC to compile it.
    >>>

    >>
    >> The tutorial says use 1.8.x not 1.9.x.
    >>
    >>
    >>> To reproduce it go into your ext/tk library and run extconf.rb (and
    >>> nmake I guess). =C2=A0It should fail.
    >>>

    >>
    >> Reproduce what? I don't understand.
    >>
    >>>>> Your only hope after that point is to somehow make them accessible (i=

    n
    >>>>> your case, by building Tcl/Tk using the same compiler you used to bui=

    ld
    >>>>> ruby, then installing tk_as_gem).
    >>>>
    >>>> My only hope? What about figuring out why it didn't work, fix the
    >>>> problem and try again?
    >>>
    >>> Please do.

    >>
    >>
    >> I'm trying. That's why I'm here. It seems that tk library is not in the
    >> right place when compiling. Is that it? Then where should it be so I can
    >> check and see if it's there?
    >>
    >>
    >>
    >>>
    >>>> The tutorial says do not use the installer. I'd like to get one thing
    >>>> working before moving on to something else I don't understand. I didn'=

    t
    >>>> find anything helpful in those links. If you'd like to link the specif=

    ic
    >>>> page that points to the answer to my problem I'd be happy to read it.
    >>>
    >>> The tutorial contains instructions on how to build it from source...

    >>
    >> Uh, ya.
    >>
    >>>
    >>>>> Also ffi-tk might fit the bill.
    >>>
    >>> Do you have any response to this (it's a gem)?

    >>
    >> I don't know what that is or what a gem is. I'm a newb at the beginning
    >> trying to follow a tutorial. I know very little about ruby.
    >>
    >>
    >>>
    >>> Anyway, to make it easier I packaged up one for you.
    >>> I downloaded 1.9.1p429 from http://rubyinstaller.org/downloads/
    >>> then downloaded "=E2=97=A6Ruby/Tk environment" from from
    >>> http://www.ruby-forum.com/topic/210186#new
    >>> and unpackaged it to the appropriate directory.
    >>>
    >>> http://faithpromotingrumors.org/incoming/ruby-1.9.1-p429-i386-mingw32.7=

    z
    >>>
    >>> GL.
    >>> -r

    >>
    >> don't know what any of that means.

    >
    > Ok I've unzipped this thing now how do I install it? And what would I do
    > if you didn't make me this? I'd really like to get the original problem
    > fixed and figure out how to get the 1.8.x source compiled and working as
    > in that tutorial. I'd like to know how to get the proper files in the
    > right place and understand what I'm doing not "click one button and have
    > it magically work".
    >
    > I don't want to start getting sidetracked. How can I build the 1.8.x
    > source properly with tk and avoid this error? That was my original
    > question. I also need to get this working on my Unix machine next (or in
    > parallel). As far as I know there is no "one-click installer" for that.
    > I need to know what goes where. Aren't there any install instructions
    > anywhere?


    gem install ffi-tk

    That should work on any platform, be it 64bit, 32bit, windows, linux,
    MRI, or JRuby.

    The issue is that all existing tutorials are written with ruby-tk in
    mind, some of the API is different.

    --=20
    Michael Fellinger
    CTO, The Rubyists, LLC
    Michael Fellinger, Jul 21, 2010
    #19
  20. From: Rich Leblanc <>
    Subject: Re: LoadError: no such file to load -- tk
    Date: Wed, 21 Jul 2010 15:03:41 +0900
    Message-ID: <>
    > Actually I would like to get this fixed on my Unix machine too. I'm
    > getting this same error. I have tcl8.5.8 installed and Ruby 1.8.7. How
    > can I get it to work on Unix? Maybe if I get that working I'll


    Please tell me the directories of your Tcl/Tk headers/libraries, and
    configure options which you gave at first step of compiling.
    Probably, ext/tk/extconf.rb outputs some messages about searching and
    testing Tcl/Tk libraries (and {tcl,tk}Config.sh) during make steps.
    Please tell me the messages, too.
    --
    Hidetoshi NAGAI ()
    Department of Artificial Intelligence, Kyushu Institute of Technology
    Hidetoshi NAGAI, Jul 21, 2010
    #20
    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. Ruby Ruby
    Replies:
    0
    Views:
    182
    Ruby Ruby
    Apr 22, 2004
  2. Brian Takita
    Replies:
    7
    Views:
    310
    Brian Takita
    May 24, 2005
  3. Zoong Pham
    Replies:
    1
    Views:
    266
    Chad Fowler
    Aug 11, 2005
  4. Replies:
    1
    Views:
    307
    Eric Hodel
    Oct 25, 2005
  5. anne001
    Replies:
    4
    Views:
    132
    Jaypee
    Nov 16, 2005
Loading...

Share This Page