From: Hidetoshi NAGAI on
From: Rich Leblanc <rl001(a)pacbell.net>
Subject: Re: LoadError: no such file to load -- tk
Date: Wed, 21 Jul 2010 03:50:10 +0900
Message-ID: <c3dd9cbcf8eadc1284f794414063b294(a)ruby-forum.com>
> > 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 (nagai(a)ai.kyutech.ac.jp)
Department of Artificial Intelligence, Kyushu Institute of Technology

From: Roger Pack on

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

From: Rich Leblanc on
Hidetoshi NAGAI wrote:
> From: Rich Leblanc <rl001(a)pacbell.net>
> Subject: Re: LoadError: no such file to load -- tk
> Date: Wed, 21 Jul 2010 03:50:10 +0900
> Message-ID: <c3dd9cbcf8eadc1284f794414063b294(a)ruby-forum.com>
>> > 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/.

From: Roger Pack on

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

From: Rich Leblanc on
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/.