LoadError: no such file to load -- tk

R

Roger Pack

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

You don't need to install it, just cd into the
"ruby-1.9.1-p429-i386-mingw32\bin" directory and run ruby/irb or what
not (or add that folder to your PATH).

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?

Unfortunately your original quest was to build ruby using VC with the Tk
extension installed. I've never done that. The "main line" ruby
installer has moved to mingw so almost *nobody* does that anymore. You
are treading in difficult waters and unless you want to tread alone, I
would recommend going with a more standard approach. The directions in
that tutorial are out of date. Why punish yourself?

If you follow my instructions *already given you* for building it with
mingw (search for "ruby18"), it will work for both ruby18 or ruby19,
depositing a working ruby into sandbox/ruby_mingw for you to work with.

Currently there isn't a one click distributable for 1.9 that has Tk, but
it's in the works. If you want a one click distributable for 1.8 that
has Tk, search the above threads for "RC2"

GL!
-r
 
R

Rich Leblanc

Hidetoshi said:
From: Rich Leblanc <[email protected]>
Subject: Re: LoadError: no such file to load -- tk
Date: Wed, 21 Jul 2010 11:16:27 +0900


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

I have installed ActiveTcl 8.5.8.2 (64-bit)
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.

Ah-ha, it says; ruby 1.8.7 (2009-12-24 patchlevel 248)
[i386-mswin32_100]
That's it!
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.

I installed the 32 bit versions but now having errors with the Microsoft
compiler. So dealing with that now.
 
R

Rich Leblanc

Michael said:
gem install ffi-tk

I'm sorry I don't know what this means. Is this a command I'm supposed
to run from a Unix command line? A little more info please.
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,

that's fine, that's what I'm trying to learn.

some of the API is different.

I don't know what you mean. Elaborate, more than a one-liner please.
 
R

Rich Leblanc

Hidetoshi said:
From: Rich Leblanc <[email protected]>
Subject: Re: LoadError: no such file to load -- tk
Date: Wed, 21 Jul 2010 15:03:41 +0900


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.

On a FreeBSD 8.0 machine I went to \usr\ports\lang\tcl85 and as root
ran; make install clean. This installed tcl 8.5. On command line if I
run; tclsh85 I get tcl prompt. Then if i type; info patchlevel it shows;
8.5.8.

Now I go to usr\ports\lang\ruby18 and run; make install clean. This
installs ruby 1.8. If I type; ruby -v at the command line I get:

ruby 1.8.7 (2009-12-24 patchlevel 248) [amd64-freebsd8]

If I start irb and type; require 'tk' I get the error:
LoadError: no such file to load -- tk

Everything is in default locations. Ruby and tcl executables are in
\usr\local\bin. I don't know where the installer put anything else.
 
R

Rich Leblanc

Roger said:
You don't need to install it, just cd into the
"ruby-1.9.1-p429-i386-mingw32\bin" directory and run ruby/irb or what
not (or add that folder to your PATH).

Ok, gotcha. did that.
Unfortunately your original quest was to build ruby using VC with the Tk
extension installed. I've never done that. The "main line" ruby
installer has moved to mingw so almost *nobody* does that anymore.

Ok that's fine, so what are people doing now?

You are treading in difficult waters and unless you want to tread alone, I
would recommend going with a more standard approach. The directions in
that tutorial are out of date. Why punish yourself?

I didn't know it was out of date. That's the one I always find when I
search for "ruby tutorial". I'd be happy to dump VC and go with mingw.
Currently there isn't a one click distributable for 1.9 that has Tk, but
it's in the works.
If you want a one click distributable for 1.8 that
has Tk, search the above threads for "RC2"

I really don't care if it's 1.8 or 1.9. I just want to do GUI
programming with ruby/tk.

It sounds like the options are:
1. compile tk into ruby 1.8 (with mingw)
2. use 1.8 one-click installer that has tk
3. Compile tk into 1.9.
4. Use the 1.9 you made me until a 1.9 one-click installer comes out
with tk.

Is there any reason to stick with 1.8? I only did because that tutorial
said to. If I should forget 1.8 and move to 1.9 that's fine I don't
care. I prefer to have the latest anyway.
 
R

Rich Leblanc

Thanks Roger. I'm up and running now on Windows using the one you made.
I'm going to read up on the ruby installer. Now I just need to get it
going on Unix, same problem.

Rich
 
C

Charles Oliver Nutter

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.

Cool, I didn't know about this. How complete is it?

- Charlie
 
M

Michael Fellinger

Cool, I didn't know about this. How complete is it?

It's complete, covers all of the tk API. It's the same project I
mentioned a few months ago in IRC.
Haven't tried all the functionality recently on JRuby, but it should
with --1.9 for most things.
 
R

Rich Leblanc

Rich said:
Thanks Roger. I'm up and running now on Windows using the one you made.
I'm going to read up on the ruby installer. Now I just need to get it
going on Unix, same problem.

Rich

I copied your directory tree over and it works but in windows when you
install things doesn't it have to make registry entries or anything
besides copying files and folders? Isn't that what installers do? Or
does Ruby not require any of that? To install Ruby is it just a matter
of copying files and folders? I'm still reading about the installer but
it's not making any sense yet.
 
R

Rich Leblanc

Rich said:
I copied your directory tree over and it works but in windows when you
install things doesn't it have to make registry entries or anything
besides copying files and folders? Isn't that what installers do? Or
does Ruby not require any of that? To install Ruby is it just a matter
of copying files and folders? I'm still reading about the installer but
it's not making any sense yet.

I'm following this tutorial:
http://www.ruby-lang.org/en/documentation/quickstart/

It says:
"If you’re using Windows, open fxri from the Ruby section of your Start
Menu."

I don't have that. I guess it's because I just copied your directory
tree over and didn't install it the "right" way. See? this is why I want
to learn to do things the correct way.
 
L

Luis Lavena

I'm following this tutorial:http://www.ruby-lang.org/en/documentation/quickstart/

It says:
"If you’re using Windows, open fxri from the Ruby section of your Start
Menu."

I don't have that. I guess it's because I just copied your directory
tree over and didn't install it the "right" way. See? this is why I want
to learn to do things the correct way.

In Ruby there is no "correct" or incorrect way, there are different
paths to achieve the same or similar results.

What you're reading is a reference to FXRI, which was part of One-
Click Installer, but is no longer part of the newer installer, which
are lean packages around vanilla ruby.

If you copied or extracted an independent package (no installer) then
is logical you will not have menu to look for options.

If you install RubyInstaller, any of the versions, you can click
"Interactive Ruby" and you will be able to use IRB.

Or from the command line, just call "irb"
 
R

Roger Pack

I copied your directory tree over and it works but in windows when you
install things doesn't it have to make registry entries or anything
besides copying files and folders? Isn't that what installers do? Or
does Ruby not require any of that? To install Ruby is it just a matter
of copying files and folders? I'm still reading about the installer but
it's not making any sense yet.

Ruby on windows is built to be self contained, and you can move it all
over the place and just use it.
You *can* get an install that uses the registry (and hence can't be
moved) over at rubyinstaller.org. The package I gave you isn't like
that.
-r
 
H

Hidetoshi NAGAI

From: Rich Leblanc <[email protected]>
Subject: Re: LoadError: no such file to load -- tk
Date: Thu, 22 Jul 2010 09:47:35 +0900
Message-ID: said:
On a FreeBSD 8.0 machine I went to \usr\ports\lang\tcl85 and as root
ran; make install clean. This installed tcl 8.5. On command line if I

I need the messages at ext/tk step of "make".
 
R

Rich Leblanc

Roger said:
Ruby on windows is built to be self contained, and you can move it all
over the place and just use it.
You *can* get an install that uses the registry (and hence can't be
moved) over at rubyinstaller.org. The package I gave you isn't like
that.
-r

Yes, I know. How can I build Ruby that includes tk and an installer to
install it to windows? Since there's no "right" or "wrong" way then how
am I supposed to know what to do?
 
R

Rich Leblanc

Roger said:
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"

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


I think so.


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

Ok I got Inno Setup 5 now what? Couldn't figure out the next step from
that site.

if you run a rake from there

Where is "there"?
(rake ruby18)
it should build ruby with the tk extension built.

Don't know how to do this. The site says;

"Ensure you are connected to the Internet, open a Command Prompt, 'cd'
to the
project root directory,"


What is the "project root directory"?
 
R

Rich Leblanc

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

Ok, I got those.
and unpackaged it to the appropriate directory.

What does that mean? You ran the Ruby installer to create a directory
tree on windows, then copied "â—¦Ruby/Tk environment" to the "appropriate
directory" (whatever that is) then gave a copy of the whole resultant
directory tree to me? What is the "appropriate directory"? If you use
explicit paths it would be a lot easier for me to understand.
 
R

Roger Pack

Rich said:
Ok, I got those.


What does that mean? You ran the Ruby installer to create a directory
tree on windows, then copied "â—¦Ruby/Tk environment" to the "appropriate
directory" (whatever that is) then gave a copy of the whole resultant
directory tree to me? What is the "appropriate directory"? If you use
explicit paths it would be a lot easier for me to understand.

I unzipped a .7z file from rubyinstaller,
then followed the instructions on
http://www.dumbo.ai.kyutech.ac.jp/~nagai/RubyTk/?Ruby/Tk-Kit

specifically "Ruby/Tk environment (please extract at RubyInstaller's
lib/ruby/1.9.1) :
rubytk-simple-w-img_ext-20100523-for-RubyInstaller191.zip"

HTH.
-r
 
L

Luis Lavena

Ok, I got those.


What does that mean? You ran the Ruby installer to create a directory
tree on windows, then copied "â—¦Ruby/Tk environment" to the "appropriate
directory" (whatever that is) then gave a copy of the whole resultant
directory tree to me? What is the "appropriate directory"? If you use
explicit paths it would be a lot easier for me to understand.

He can't use explicit paths in the example because he doesn't know
your setup.

You need to find your way too, don't expect receive a 100% to the
letter type of instructions since you're not providing enough details.

I believe you are getting over complicated and Roger's instructions
are not helping you because the instructions expect certain knowledge
of build tools and building Ruby.

You should try the following, and if doesn't work, start a new thread
instead of this eternal back and forth between so many instructions:

1) Download Ruby 1.9.1 installers form RubyInstaller website.

http://rubyinstaller.org/

2) Install the Development Kit, accessible from the same website and
follow the instructions detailed here:

http://wiki.github.com/oneclick/rubyinstaller/development-kit

3) Install Tcl, or if you have already installed, figure it out where
it was installed in your system.

4) Take note of Tcl location and add the binaries location to the
PATH:

SET PATH=<path to Tcl bin directory>;%PATH%

5) Install tk-win gem:

gem install tk-win

6) Start using it

require 'rubygems'
require 'tk'
 
R

Rich Leblanc

Hidetoshi said:
From: Rich Leblanc <[email protected]>
Subject: Re: LoadError: no such file to load -- tk
Date: Thu, 22 Jul 2010 09:47:35 +0900


I need the messages at ext/tk step of "make".


Here's all the output from the terminal:

# make install clean
===> Installing for tcl-8.5.8
===> tcl-8.5.8 depends on file:
/usr/local/lib/tcl8/8.5/tcltest-2.3.2.tm - found
===> Generating temporary packing list
===> Checking if lang/tcl85 already installed
Installing libtcl85.so.1 to /usr/local/lib/
Installing libtcl85.a
Installing tclsh as /usr/local/bin/tclsh8.5
Installing tclConfig.sh to /usr/local/lib/tcl8.5/
Installing libtclstub85.a to /usr/local/lib/
Installing message catalogs
Creating msgs
Making directory /usr/local/include/tcl8.5/generic
Making directory /usr/local/include/tcl8.5/unix
Making directory /usr/local/lib/tcl8.5/opt0.4
Making directory /usr/local/lib/tcl8.5/http1.0
Making directory /usr/local/lib/tcl8.5/encoding
Installing header files
Installing library files to /usr/local/lib/tcl8.5
Installing library http1.0 directory
Installing library opt0.4 directory
Installing library encoding directory
Installing time zone data
Creating tzdata
Creating Australia
Creating Canada
Creating Arctic
Creating Asia
Creating Africa
Creating America
Creating North_Dakota
Creating Indiana
Creating Kentucky
Creating Argentina
Creating Indian
Creating SystemV
Creating Pacific
Creating Etc
Creating Chile
Creating US
Creating Brazil
Creating Atlantic
Creating Mexico
Creating Antarctica
Creating Europe
/bin/mkdir -p /usr/local/share/tcl8.5
install -o root -g wheel -m 444
/usr/ports/lang/tcl85/work/tcl8.5.8/unix/../doc/man.macros
/usr/local/share/tcl8.5
/bin/mkdir -p /usr/local/man/man1
install -o root -g wheel -m 444
/usr/ports/lang/tcl85/work/tcl8.5.8/unix/../doc/tclsh.1
/usr/local/man/man1/tclsh8.5.1
Installing and cross-linking C API (.3) docs
Installing and cross-linking command (.n) docs
**********
IMPORTANT:
**********
tclConfig.sh in /usr/local/lib/tcl8.5/tclConfig.sh
tcl.h in /usr/local/include/tcl8.5/tcl.h
tclDecls.h in /usr/local/include/tcl8.5/tclDecls.h
There are NOT default place, but good place to avoid
conflicting with another version of Tcl/Tks.
===> Compressing manual pages for tcl-8.5.8
===> Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===> Registering installation for tcl-8.5.8
===> SECURITY REPORT:
This port has installed the following files which may act as
network
servers and may therefore pose a remote security risk to the
system.
/usr/local/lib/libtcl85.so.1

If there are vulnerabilities in these programs there may be a
security
risk to the system. FreeBSD makes no guarantee about the security
of
ports included in the Ports Collection. Please type 'make
deinstall'
to deinstall the port if this is a concern.

For more information, and contact details about the security
status of this software, see the following webpage:
http://www.tcl.tk/
===> Cleaning for tcl-8.5.8
 
R

Roger Pack

I need the messages at ext/tk step of "make".

Here's all the output from the terminal:
# make install clean
===> Installing for tcl-8.5.8
===> tcl-8.5.8 depends on file:
/usr/local/lib/tcl8/8.5/tcltest-2.3.2.tm - found

He wanted the messages from the output of ruby/ext/tk step of "make"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top