# How to install/use ruby and tk on winxp?

**URL:** <https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901>\
**Category:** Ruby\
**Created:** [January 22, 2007, 9:06am UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901 "2007-01-22T09:06:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [January 22, 2007, 9:06am UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/1 "2007-01-22T09:06:17Z")

</div>

Hello  
Im a newby with ruby. Im trying to do some user interface with tk. I  
have Ruby 1.8.5-21 and it’s working fine.  
I also installed activestate tcl 8.5.0.0 beta-6. From there on, I don’t  
really know how to bind Ruby and tk together to create some GUI.  
Any suggestion?

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [January 22, 2007, 11:46am UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/2 "2007-01-22T11:46:02Z")

</div>

Sean wrote:

> Hello  
> Im a newby with ruby. Im trying to do some user interface with tk. I  
> have Ruby 1.8.5-21 and it’s working fine.  
> I also installed activestate tcl 8.5.0.0 beta-6. From there on, I don’t  
> really know how to bind Ruby and tk together to create some GUI.  
> Any suggestion?

You probably should have used the one-click installer.

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [January 22, 2007, 5:25pm UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/3 "2007-01-22T17:25:45Z")

</div>

hello,

I used the one click installer to install Ruby.  
then I try to run a test using this code:  
require ‘tk’  
root = TkRoot.new { title “Ex1” }TkLabel.new(root) {  
text ‘Hello, World!’  
pack { padx 15 ; pady 15; side ‘left’ }  
}  
Tk.mainloop

however a popup tells me that:  
“This application has failed to start because tk84.dll was not found.  
re-installing the application may fix this problem.”  
So should i reinstall ruby again?  
And here is the cmd line error screen.  
C:\ruby\_prog\>ruby gui.rb  
c:/ruby/lib/ruby/1.8/i386-mswin32/tcltklib.so: 126: The specified  
module could not be found. -  
c:/ruby/lib/ruby/1.8/i386-mswin32/tcltklib.so (LoadError)  
from  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' from c:/ruby/lib/ruby/1.8/tk.rb:7 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`gem\_original\_require’  
from  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require’  
from gui.rb:1

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [January 22, 2007, 12:15pm UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/4 "2007-01-22T12:15:17Z")

</div>

On 1/22/07, Sean [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello  
> Im a newby with ruby. Im trying to do some user interface with tk. I  
> have Ruby 1.8.5-21 and it’s working fine.  
> I also installed activestate tcl 8.5.0.0 beta-6. From there on, I don’t  
> really know how to bind Ruby and tk together to create some GUI.  
> Any suggestion?

If you use the one click installer tk is included.  
[http://rubyforge.org/projects/rubyinstaller/](http://rubyforge.org/projects/rubyinstaller/)

I don’t know of any books about ruby tk but try this;  
[http://www.rubycentral.com/book/ext\_tk.html](http://www.rubycentral.com/book/ext_tk.html)

Harry

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [January 23, 2007, 1:15am UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/5 "2007-01-23T01:15:25Z")

</div>

On 1/23/07, Sean [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> however a popup tells me that:  
> “This application has failed to start because tk84.dll was not found.  
> re-installing the application may fix this problem.”  
> So should i reinstall ruby again?

I installed an older version with no problem.  
It looks like others have experienced this, too.

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/183687](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/183687)

Harry

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [January 23, 2007, 2:23am UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/6 "2007-01-23T02:23:32Z")

</div>

From: “Sean” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: how to install/use ruby and tk on winxp?  
Date: Tue, 23 Jan 2007 01:25:06 +0900  
Message-ID: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> however a popup tells me that:  
> “This application has failed to start because tk84.dll was not found.  
> ^^^^^^^^  
> re-installing the application may fix this problem.”
> 
> On Jan 22, 5:14 am, Harry [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > On 1/22/07, Sean [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:\> Hello
> > 
> > > I also installed activestate tcl 8.5.0.0 beta-6. From there on, I don’t  
> > > ^^^  
> > > really know how to bind Ruby andtktogether to create some GUI.

Please use ActiveTcl 8.4.x.  
Maybe, tcltklib in One-Click-Installer is configured  
without “–enable-tcltk\_stubs” option.

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [January 23, 2007, 11:41pm UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/7 "2007-01-23T23:41:44Z")

</div>

Cool it works!!!

Many thx to everybody.

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [February 12, 2007, 5:40am UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/8 "2007-02-12T05:40:17Z")

</div>

On Jan 23, 2:34 pm, “Sean” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > “This application has failed to start because tk84.dll was not found. ^^^^^^^^\> re-installing the application may fix this problem.”
> 
> > > On Jan 22, 5:14 am, Harry [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > > 
> > > > On 1/22/07, Sean [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:\> Hello
> > > > 
> > > > > I also installed activestate tcl 8.5.0.0 beta-6. From there on, I don’t ^^^
> 
> > > > > really know how to bind Ruby andtktogether to create some GUI.Please use ActiveTcl 8.4.x.  
> > > > > Maybe, tcltklib in One-Click-Installer is configured  
> > > > > without “–enable-tcltk\_stubs” option.  
> > > > > –  
> > > > > Hidetoshi NAGAI (removed\_email\_address@domain.invalid)

A couple of additional details:  
I also solved the above problem in Ruby 184-17 under WinXP by  
installing  
ActiveState’s ActiveTcl 8.4, but I had to copy these folders and  
files:

- copy the folders ‘tcl8.4’ and ‘tk8.4’ from Tcl/lib to ruby/lib
- copy tk84.dll from Tcl/bin to ruby/bin

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [July 4, 2008, 4:27pm UTC](https://www.ruby-forum.com/t/how-to-install-use-ruby-and-tk-on-winxp/82901/9 "2008-07-04T16:27:14Z")

</div>

> A couple of additional details:  
> I also solved the above problem in Ruby 184-17 under WinXP by  
> installing  
> ActiveState’s ActiveTcl 8.4, but I had to copy these folders and  
> files:
> 
> - copy the folders ‘tcl8.4’ and ‘tk8.4’ from Tcl/lib to ruby/lib
> - copy tk84.dll from Tcl/bin to ruby/bin

I fixed the same problem by simply uninstalling ActiveTcl 8.5.x and  
installing the last of the 8.4.x series. Unlike above, I didn’t have to  
copy any folders or DLL’s (at least not yet).

Thanks for helping me fix the problem, folks! For others with this same  
problem, start by ensuring you have ActiveTcl 8.4.x instead of 8.5.x  
installed.
