Using Tk in Ruby 185

M

Markus Liebelt

Hello all together,

today I upgrade from Ruby 1.82 to 1.85-21, I installed it under windows
with the one-click-installer. Most of my previous work works without a
change, but I cannot get Tk working. Let me explain what is happening:

1. For 1.82, I installed ActiveTcl (Version 8332), and copied some of the
libraries to ruby.
2. I tried that as well in the new ruby installation, but when I want to
use Tk, ruby feezes, and I don't get any feedback (no error, nothing).
3. I removed the copied libraries, and tried just to use Tk in IRB.
- Start IRB, then "require 'tk'"

==> D:\programme\tcl\ActiveTcl8332>irb
irb(main):001:0> require 'tk'

Then ruby is frozen, and I have to kill the process.

What am I missing here? Is Tk in the one-click-installer not included
(seems so). What are the prerequisits for ruby to use tk widgets in ruby?
Is it necessary to have the tcl/tk binaries in the path under windows?

It would be nice if you had any idea how to locate the error. At the
moment, I don't have a clue.

Bye
Markus
 
W

Wolfgang Nádasi-Donner

Markus said:
Hello all together,

today I upgrade from Ruby 1.82 to 1.85-21, I installed it under windows
with the one-click-installer. Most of my previous work works without a
change, but I cannot get Tk working.

Tk is not part of the one-click-installer any more. See change note:

2006-02
* Updated release notes to mention that the install now
only contains bindings to Tcl/Tk and that to use Tcl/Tk
you must install it (recommending ActiveTcl).

Wolfgang Nádasi-Donner
 
H

Hidetoshi NAGAI

From: "Markus Liebelt" <[email protected]>
Subject: Using Tk in Ruby 185
Date: Sun, 4 Feb 2007 04:55:09 +0900
Message-ID: said:
today I upgrade from Ruby 1.82 to 1.85-21, I installed it under windows
with the one-click-installer. Most of my previous work works without a (snip)
1. For 1.82, I installed ActiveTcl (Version 8332), and copied some of the
libraries to ruby.

Possibly, one-click-installer 185 supports Tcl/Tk8.4 only
(see [ruby-talk:235589]).
If it is true, you have to use ActiveTcl8.4.x.
 
M

Markus Liebelt

Thank you a lot. After installing the current Tcl Environment, the
application is working again. One subtlety I have now:

The Startup-command:

D:\programme\ruby\ruby185-21\bin\ruby.exe
c:\users\mliebelt\ruby\biblio\tk-gui.rb

had to be changed. Previously, the rubyw.exe worked (so no DOS-window) was
seen. After checking the files again, I have noticed, that I inserted some
puts commands into one file. Could it be, that ruby dies when it sees a
puts, but was started with the rubyw-executable?

But anyway, the things are working again. Thanks a lot to all that helped.

Bye
Markus

From: "Markus Liebelt" <[email protected]>
Subject: Using Tk in Ruby 185
Date: Sun, 4 Feb 2007 04:55:09 +0900
Message-ID: said:
today I upgrade from Ruby 1.82 to 1.85-21, I installed it under windows
with the one-click-installer. Most of my previous work works without a (snip)
1. For 1.82, I installed ActiveTcl (Version 8332), and copied some of
the
libraries to ruby.

Possibly, one-click-installer 185 supports Tcl/Tk8.4 only
(see [ruby-talk:235589]).
If it is true, you have to use ActiveTcl8.4.x.
 
C

Canol Gokel

Wolfgang said:
Tk is not part of the one-click-installer any more. See change note:

2006-02
* Updated release notes to mention that the install now
only contains bindings to Tcl/Tk and that to use Tcl/Tk
you must install it (recommending ActiveTcl).

Wolfgang N�dasi-Donner

Do you know what the reason is? I just started to learn Ruby. I hardly
made the decision between Python and Ruby. Now, Python still has a
distribution with Tk (at least under Windows) and Ruby has not. So I
have to ask my software users also to install ActiveTcl as well as the
Ruby interpreter (total of 45 mb) and hope they won't have any trouble
:(
 
A

Andrew Thompson

Canol said:
So I
have to ask my software users also to install ActiveTcl as well as the
Ruby interpreter (total of 45 mb) and hope they won't have any trouble
:(

I've run into this problem myself. ActiveTcl has a somewhat annoying
license as regards redistribution, so I just took the one
click-installer, gutted it and built my own tcl/tk to go with it. So I
have an entire ruby/tk environment in ~6 megs zipped with no
redistribution restrictions. No fancy installer (yet) but it works well
so far...

Andrew
 

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,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top