# Using Tk in Ruby 185

**URL:** <https://www.ruby-forum.com/t/using-tk-in-ruby-185/84385>\
**Category:** Ruby\
**Created:** [February 3, 2007, 8:56pm UTC](https://www.ruby-forum.com/t/using-tk-in-ruby-185/84385 "2007-02-03T20:56:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [February 3, 2007, 8:56pm UTC](https://www.ruby-forum.com/t/using-tk-in-ruby-185/84385/1 "2007-02-03T20:56:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [February 3, 2007, 9:59pm UTC](https://www.ruby-forum.com/t/using-tk-in-ruby-185/84385/2 "2007-02-03T21:59:15Z")

</div>

Markus L. schrieb:

> 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

---

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [February 4, 2007, 5:34am UTC](https://www.ruby-forum.com/t/using-tk-in-ruby-185/84385/3 "2007-02-04T05:34:49Z")

</div>

From: “Markus L.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Using Tk in Ruby 185  
Date: Sun, 4 Feb 2007 04:55:09 +0900  
Message-ID: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

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

---

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [February 4, 2007, 2:20pm UTC](https://www.ruby-forum.com/t/using-tk-in-ruby-185/84385/4 "2007-02-04T14:20:35Z")

</div>

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

On Sun, 04 Feb 2007 05:34:36 +0100, Hidetoshi NAGAI

---

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [April 1, 2007, 11:54pm UTC](https://www.ruby-forum.com/t/using-tk-in-ruby-185/84385/5 "2007-04-01T23:54:58Z")

</div>

Wolfgang NÃ¡dasi-donner wrote:

> 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  
☹

---

<div class="post-metadata">

**Author:** ![uberalles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/e47774/32.png) [@uberalles](https://www.ruby-forum.com/u/uberalles)\
**Post date:** [April 2, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/using-tk-in-ruby-185/84385/6 "2007-04-02T18:19:56Z")

</div>

Canol Gokel wrote:

> 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
