Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: Tk

  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tk

    How can I use Tk with Ruby?

    I tried the statement:
    require 'tk'

    But it gives me this error:
    LoadError: no such file to load -- tk

    Do I have to install tk for it to work?

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Quote Originally Posted by MindTheGap View Post
    Do I have to install tk for it to work?
    ofcourse... its like do i have to install word before i can open a word document
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by MindTheGap View Post
    How can I use Tk with Ruby?

    I tried the statement:
    require 'tk'

    But it gives me this error:
    LoadError: no such file to load -- tk

    Do I have to install tk for it to work?
    look also to this:

    http://members.chello.nl/k.vangelder/ruby/learntk/

    best regards

  • #4
    New Coder
    Join Date
    Jul 2007
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok. I dowloaded tk. Where do I put the file?


    I put it in the ruby folder. I typed ./configure, then make but got this error:
    compiling readline
    gcc -I. -I../../.ext/include/i686-darwin8.11.1 -I../.././include -I../.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -fno-common -g -O2 -pipe -fno-common -o readline.o -c readline.c
    readline.c: In function 'filename_completion_proc_call':
    readline.c:659: error: 'filename_completion_function' undeclared (first use in this function)
    readline.c:659: error: (Each undeclared identifier is reported only once
    readline.c:659: error: for each function it appears in.)
    readline.c:659: warning: assignment makes pointer from integer without a cast
    readline.c: In function 'username_completion_proc_call':
    readline.c:684: error: 'username_completion_function' undeclared (first use in this function)
    readline.c:684: warning: assignment makes pointer from integer without a cast
    make[1]: *** [readline.o] Error 1
    make: *** [all] Error 1

  • #5
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by MindTheGap View Post
    Ok. I dowloaded tk. Where do I put the file?


    I put it in the ruby folder. I typed ./configure, then make but got this error:
    compiling readline
    gcc -I. -I../../.ext/include/i686-darwin8.11.1 -I../.././include -I../.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -fno-common -g -O2 -pipe -fno-common -o readline.o -c readline.c
    readline.c: In function 'filename_completion_proc_call':
    readline.c:659: error: 'filename_completion_function' undeclared (first use in this function)
    readline.c:659: error: (Each undeclared identifier is reported only once
    readline.c:659: error: for each function it appears in.)
    readline.c:659: warning: assignment makes pointer from integer without a cast
    readline.c: In function 'username_completion_proc_call':
    readline.c:684: error: 'username_completion_function' undeclared (first use in this function)
    readline.c:684: warning: assignment makes pointer from integer without a cast
    make[1]: *** [readline.o] Error 1
    make: *** [all] Error 1
    - seems you don't have the proper headers. Do you run on mac?
    - tk work with tcl, do you have tcl installed?

    best regards

  • #6
    New Coder
    Join Date
    Jul 2007
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, I'm on a mac. Where can I get the proper headers?

    Where can I get tcl from?



    Thanks.

  • #7
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by MindTheGap View Post
    Yeah, I'm on a mac. Where can I get the proper headers?
    usualy they come with tcl and tk but some come with system libs.

    Where can I get tcl from?
    same place you get tk.

    Sorry, I have no experience with this on mac, I don't think that my answers could help in this case.

    best regards

  • #8
    New Coder
    Join Date
    Jul 2007
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, thanks.


    How do I install tk/tcl after I have downloaded it?

  • #9
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by MindTheGap View Post
    Ok, thanks.


    How do I install tk/tcl after I have downloaded it?
    Few years ago I use this for a multiplatform project and I was happy:

    http://www.activestate.com/Products/activetcl/

    PS: seems to be a problem with readline and ruby 1.8.6 on mac.

    http://wincent.com/knowledge-base/Bu...Mac_OS_X_Tiger

    best regards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •