Go Back   CodingForums.com > :: Server side development > Ruby & Ruby On Rails

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2008, 01:12 PM   PM User | #1
MindTheGap
New Coder

 
Join Date: Jul 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
MindTheGap is an unknown quantity at this point
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?
MindTheGap is offline   Reply With Quote
Old 01-17-2008, 01:38 PM   PM User | #2
shyam
Senior Coder

 
shyam's Avatar
 
Join Date: Jul 2005
Posts: 1,563
Thanks: 2
Thanked 163 Times in 160 Posts
shyam will become famous soon enough
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
shyam is offline   Reply With Quote
Old 01-17-2008, 02:49 PM   PM User | #3
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
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
oesxyl is offline   Reply With Quote
Old 01-17-2008, 03:24 PM   PM User | #4
MindTheGap
New Coder

 
Join Date: Jul 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
MindTheGap is an unknown quantity at this point
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
MindTheGap is offline   Reply With Quote
Old 01-17-2008, 03:51 PM   PM User | #5
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
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
oesxyl is offline   Reply With Quote
Old 01-17-2008, 04:19 PM   PM User | #6
MindTheGap
New Coder

 
Join Date: Jul 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
MindTheGap is an unknown quantity at this point
Yeah, I'm on a mac. Where can I get the proper headers?

Where can I get tcl from?



Thanks.
MindTheGap is offline   Reply With Quote
Old 01-17-2008, 04:31 PM   PM User | #7
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
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.

Quote:
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
oesxyl is offline   Reply With Quote
Old 01-17-2008, 04:44 PM   PM User | #8
MindTheGap
New Coder

 
Join Date: Jul 2007
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
MindTheGap is an unknown quantity at this point
Ok, thanks.


How do I install tk/tcl after I have downloaded it?
MindTheGap is offline   Reply With Quote
Old 01-17-2008, 05:11 PM   PM User | #9
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
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
oesxyl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:25 PM.


Advertisement
Log in to turn off these ads.