# Problem when require 'tk'

**URL:** <https://www.ruby-forum.com/t/problem-when-require-tk/132105>\
**Category:** Ruby\
**Created:** [March 17, 2008, 2:27am UTC](https://www.ruby-forum.com/t/problem-when-require-tk/132105 "2008-03-17T02:27:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dongzhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/90db22/32.png) [@dongzhi](https://www.ruby-forum.com/u/dongzhi)\
**Post date:** [March 17, 2008, 2:27am UTC](https://www.ruby-forum.com/t/problem-when-require-tk/132105/1 "2008-03-17T02:27:36Z")

</div>

Hi All,

My OS is Fedora. I download Ruby source and comppiled. I download  
ActiveTcl and installed. But, when I do require ‘tk’, ruby say:  
LoadError:no such file to load – tk.

Please help me.

Thanks.

---

<div class="post-metadata">

**Author:** ![dongzhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/90db22/32.png) [@dongzhi](https://www.ruby-forum.com/u/dongzhi)\
**Post date:** [March 17, 2008, 5:01am UTC](https://www.ruby-forum.com/t/problem-when-require-tk/132105/2 "2008-03-17T05:01:48Z")

</div>

Liu Ming wrote:

> Hi All,
> 
> My OS is Fedora. I download Ruby source and comppiled. I download  
> ActiveTcl and installed. But, when I do require ‘tk’, ruby say:  
> LoadError:no such file to load – tk.
> 
> Please help me.
> 
> Thanks.

It seems you may have installed Ruby then Tcl, so you may need to  
recompile Ruby to use it.  
Try the information here: [TkDocs Tutorial - Installing Tk](http://www.tkdocs.com/tutorial/install.html)

-Justin

---

<div class="post-metadata">

**Author:** ![dongzhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/90db22/32.png) [@dongzhi](https://www.ruby-forum.com/u/dongzhi)\
**Post date:** [March 17, 2008, 3:23pm UTC](https://www.ruby-forum.com/t/problem-when-require-tk/132105/3 "2008-03-17T15:23:26Z")

</div>

Justin C. wrote:

> Liu Ming wrote:
> 
> > Hi All,
> > 
> > My OS is Fedora. I download Ruby source and comppiled. I download  
> > ActiveTcl and installed. But, when I do require ‘tk’, ruby say:  
> > LoadError:no such file to load – tk.
> > 
> > Please help me.
> > 
> > Thanks.
> 
> It seems you may have installed Ruby then Tcl, so you may need to  
> recompile Ruby to use it.  
> Try the information here: [TkDocs Tutorial - Installing Tk](http://www.tkdocs.com/tutorial/install.html)
> 
> -Justin

Hi Justin,

Thanke you for your reply. I have followed the steps in the install  
document to setup. But, I don’t success. When I run “make” command, I  
found the “tk” module can’t be complie, please see the part of “make”  
resule:

compiling tk  
make[1]: Entering directory `/home/lm/Desktop/ruby/ext/tk' make[1]: Nothing to be done for `all’.  
make[1]: Leaving directory `/home/lm/Desktop/ruby/ext/tk' compiling tk/tkutil make[1]: Entering directory `/home/lm/Desktop/ruby/ext/tk/tkutil’  
make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/lm/Desktop/ruby/ext/tk/tkutil’

I have another question. In the install document, % ./configure  
–prefix=  
–with-tcl-dir=/opt/ActiveTcl-8.5  
–with-tk-dir=/opt/ActiveTcl-8.5  
–with-tcllib=tclstub8.5  
–with-tklib=tkstub8.5  
–enable-tcltk\_stubs  
–enable-tcl-thread  
–enable-pthread  
In here, indicate tcllib to tclstub8.5, but, I can’t found any file  
called tclstub8.5 in my Tcl installed folder.

Thanks.

---

<div class="post-metadata">

**Author:** ![dongzhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/90db22/32.png) [@dongzhi](https://www.ruby-forum.com/u/dongzhi)\
**Post date:** [March 17, 2008, 4:03pm UTC](https://www.ruby-forum.com/t/problem-when-require-tk/132105/4 "2008-03-17T16:03:14Z")

</div>

Liu Ming wrote:

> Justin C. wrote:
> 
> > Liu Ming wrote:
> > 
> > > Hi All,
> > > 
> > > My OS is Fedora. I download Ruby source and comppiled. I download  
> > > ActiveTcl and installed. But, when I do require ‘tk’, ruby say:  
> > > LoadError:no such file to load – tk.
> > > 
> > > Please help me.
> > > 
> > > Thanks.
> > 
> > It seems you may have installed Ruby then Tcl, so you may need to  
> > recompile Ruby to use it.  
> > Try the information here: [TkDocs Tutorial - Installing Tk](http://www.tkdocs.com/tutorial/install.html)
> > 
> > -Justin
> 
> Hi Justin,
> 
> Thanke you for your reply. I have followed the steps in the install  
> document to setup. But, I don’t success. When I run “make” command, I  
> found the “tk” module can’t be complie, please see the part of “make”  
> resule:
> 
> compiling tk  
> make[1]: Entering directory `/home/lm/Desktop/ruby/ext/tk' make[1]: Nothing to be done for `all’.  
> make[1]: Leaving directory `/home/lm/Desktop/ruby/ext/tk' compiling tk/tkutil make[1]: Entering directory `/home/lm/Desktop/ruby/ext/tk/tkutil’  
> make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/lm/Desktop/ruby/ext/tk/tkutil’
> 
> I have another question. In the install document, % ./configure  
> –prefix=  
> –with-tcl-dir=/opt/ActiveTcl-8.5  
> –with-tk-dir=/opt/ActiveTcl-8.5  
> –with-tcllib=tclstub8.5  
> –with-tklib=tkstub8.5  
> –enable-tcltk\_stubs  
> –enable-tcl-thread  
> –enable-pthread  
> In here, indicate tcllib to tclstub8.5, but, I can’t found any file  
> called tclstub8.5 in my Tcl installed folder.
> 
> Thanks.

I try again. I get these error below:  
/home/lm/Desktop/ruby/lib/fileutils.rb:1394:in `fu_each_src_dest': same file: bin/ri and /home/lm/Desktop/ruby/bin/ri (ArgumentError) from /home/lm/Desktop/ruby/lib/fileutils.rb:1411:in `fu\_each\_src\_dest0’  
from /home/lm/Desktop/ruby/lib/fileutils.rb:1393:in  
`fu_each_src_dest' from /home/lm/Desktop/ruby/lib/fileutils.rb:840:in `install’  
from ./instruby.rb:99:in `install' from ./instruby.rb:246 from ./instruby.rb:239:in `each’  
from ./instruby.rb:239  
from ./instruby.rb:348:in `call' from ./instruby.rb:348 from ./instruby.rb:345:in `each’  
from ./instruby.rb:345  
from ./instruby.rb:344:in `each’  
from ./instruby.rb:344  
make: \*\*\* [do-install-nodoc] Error 1

Thanks.
