Problems compiling Ruby/Tk

Hi,

I am having problems getting Ruby/Tk to work. Below are the results of
my attempts to get Tk working.

My configure command:
./configure --prefix=/opt/ruby --enable-thread

Results of make:
compiling tk
compiling tk/tkutil
compiling win32ole
compiling zlib

When I try to use tk, I get this output:

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

I have tcl/tk installed on my computer.

My environment is RedHat ES 4.0 32 bit.

What am I doing wrong?

Thanks.

Ron

Ron wrote:

Hi,

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

do you have the line
require "tk"

at the top of your program?

···

--
Posted via http://www.ruby-forum.com/\.

Message-ID: <1156497065.190539.309770@b28g2000cwb.googlegroups.com>

My configure command:
./configure --prefix=/opt/ruby --enable-thread

Results of make:
compiling tk
compiling tk/tkutil
compiling win32ole
compiling zlib

When I try to use tk, I get this output:

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

Please check the followings.

(1) Is there `tcltklib.so' on `/opt/ruby/lib/ruby/1.8/i686-linux/' ?
    ( `1.8' and 'i686-linux' depend on your binary. )
    If not, probably, you failed to compile it.
    Please read `<ruby-source>/ext/tk/README.tcltklib'.

(2) Did you execute the right binary?
    Please check RUBY_VERSION and RUBY_RELEASE_DATE on the running irb.
    Do those values denote your new ruby binary?
    If not, please try "/opt/ruby/bin/ruby -v /opt/ruby/bin/irb".

···

From: "Ron" <ron.reidy@gmail.com>
Subject: Problems compiling Ruby/Tk
Date: Fri, 25 Aug 2006 18:11:07 +0900

--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Yes. The problem manifests when used in a script or using irb (see below).

Really lost on this one and I'm hoping someone can give me some insight.

Thanks.

ron

···

On 8/28/06, Mer Gilmartin <merrua@yahoo.co.uk> wrote:

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

do you have the line
require "tk"

at the top of your program?

--
Posted via http://www.ruby-forum.com/\.

--
Ron Reidy

Hidetoshi,

Thank you so much. The README file had the answer and all is working.

rr

···

On 8/28/06, Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> wrote:

From: "Ron" <ron.reidy@gmail.com>
Subject: Problems compiling Ruby/Tk
Date: Fri, 25 Aug 2006 18:11:07 +0900
Message-ID: <1156497065.190539.309770@b28g2000cwb.googlegroups.com>
> My configure command:
> ./configure --prefix=/opt/ruby --enable-thread
>
> Results of make:
> compiling tk
> compiling tk/tkutil
> compiling win32ole
> compiling zlib
>
> When I try to use tk, I get this output:
>
> irb(main):001:0> require 'tk'
> LoadError: no such file to load -- tk
> from (irb):1:in `require'
> from (irb):1

Please check the followings.

(1) Is there `tcltklib.so' on `/opt/ruby/lib/ruby/1.8/i686-linux/' ?
    ( `1.8' and 'i686-linux' depend on your binary. )
    If not, probably, you failed to compile it.
    Please read `<ruby-source>/ext/tk/README.tcltklib'.

(2) Did you execute the right binary?
    Please check RUBY_VERSION and RUBY_RELEASE_DATE on the running irb.
    Do those values denote your new ruby binary?
    If not, please try "/opt/ruby/bin/ruby -v /opt/ruby/bin/irb".

--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

--
Ron Reidy

Ron Reidy wrote:

Yes. The problem manifests when used in a script or using irb (see
below).

Really lost on this one and I'm hoping someone can give me some insight.

Thanks.

ron

Know the feeling. Im new to this ruby/tk myself but I got my windows
installation working.

Have you checked directory paths?
Could the address be wrong for tk or ruby?
If its installed maybe the problem is it cant find it?

Ive also seen the line
#!/usr/bin/env ruby
added to programs to help it work.

···

--
Posted via http://www.ruby-forum.com/\.

Mer Gilmartin wrote:

Ive also seen the line
#!/usr/bin/env ruby
added to programs to help it work.

That shouldn't do a thing to Tk, and especially not on Windows (Cygwin notwithstanding). Only Linux shells interpret that line.

David Vallner

That shouldn't do a thing to Tk, and especially not on Windows (Cygwin
notwithstanding). Only Linux shells interpret that line.

Ok. Wasnt sure of its purpose.

···

--
Posted via http://www.ruby-forum.com/\.