Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Help with tkHTML (specifically, require 'tkextlib/tkHTML' fails to find package)

Reply
Thread Tools

Help with tkHTML (specifically, require 'tkextlib/tkHTML' fails to find package)

 
 
Randy Kramer
Guest
Posts: n/a
 
      03-25-2006
(Ruby 1.8.4 on Mandriva2006)

I need some help with tkHTML. The current problem is that, if I try to follow
this example (from
http://groups.google.com/group/comp....7a7e153dabd20f ):

require 'tk'
require 'tkextlib/tkHTML'

.. read a HTML-doc, and set it to the variable 'doc' ...

hv = Tk::HTML_Widget.new.pack
hv.parse(doc)

It fails at the step =require 'tkextlib/tkHTML'= with a message:

RuntimeError: TkPackage can't find package Tkhtml
from /usr/local/lib/ruby/1.8/tk/package.rb:86:in `require'
from /usr/local/lib/ruby/1.8/tkextlib/tkHTML/htmlwidget.rb:15
from /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb:13
from (irb):2

What I've done (generally):

I may have confused the issue, because I've downloaded and installed both
ActiveTCL and the standalone ktHTML packages. I installed the ktHTML package
first, and tried the example before installing ActiveTCL, but got the same
result.

At one point, from somewhere I got the hint that I should run the setup.rb
files, so I found one in /usr/local/lib/ruby/1.8/tkextlib and another
in /usr/local/lib/ruby/1.8/tkextlib/tkHTML. They are not executable, so I
ran them as ruby scripts, i.e. =ruby setup.rb= from the directory containing
the files. No improvement.

Some observations:

Directory /usr/local/lib/ruby/1.8/tkextlib contains, among other things:

tkHTML/ tkHTML.rb

Directory /usr/local/lib/ruby/1.8/tkextlib/tkHTML contains:

htmlwidget.rb setup.rb

Line 13 in /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb is:

require 'tkextlib/tkHTML/htmlwidget'

Any hints?

Randy Kramer



 
Reply With Quote
 
 
 
 
Logan Capaldo
Guest
Posts: n/a
 
      03-25-2006
--Apple-Mail-2--342170666
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed


On Mar 25, 2006, at 4:01 PM, Randy Kramer wrote:

> At one point, from somewhere I got the hint that I should run the
> setup.rb
> files, so I found one in /usr/local/lib/ruby/1.8/tkextlib and another
> in /usr/local/lib/ruby/1.8/tkextlib/tkHTML. They are not
> executable, so I
> ran them as ruby scripts, i.e. =ruby setup.rb= from the directory
> containing
> the files. No improvement.


Did you try:

sudo ruby setup.rb install

?


--Apple-Mail-2--342170666--


 
Reply With Quote
 
 
 
 
Randy Kramer
Guest
Posts: n/a
 
      03-25-2006
On Saturday 25 March 2006 04:14 pm, Logan Capaldo wrote:
> Did you try:
>
> sudo ruby setup.rb install


Thanks for the response!

No, at least I hadn't. I've now tried it, didn't solve the problem. (I ran
the setup in both tkextlib and tkHTML, and it now seems that the require 'tk'
statement returns true much sooner, but still the same problem with the
require 'tkextlib/tkHTML':

RuntimeError: TkPackage can't find package Tkhtml
from /usr/local/lib/ruby/1.8/tk/package.rb:86:in `require'
from /usr/local/lib/ruby/1.8/tkextlib/tkHTML/htmlwidget.rb:15
from /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb:13
from (irb):2

Do you have tkHTML setup? Do you recall how you did it?

Randy Kramer




 
Reply With Quote
 
Logan Capaldo
Guest
Posts: n/a
 
      03-26-2006

On Mar 25, 2006, at 5:01 PM, Randy Kramer wrote:

> On Saturday 25 March 2006 04:14 pm, Logan Capaldo wrote:
>> Did you try:
>>
>> sudo ruby setup.rb install

>
> Thanks for the response!
>
> No, at least I hadn't. I've now tried it, didn't solve the
> problem. (I ran
> the setup in both tkextlib and tkHTML, and it now seems that the
> require 'tk'
> statement returns true much sooner, but still the same problem with
> the
> require 'tkextlib/tkHTML':
>
> RuntimeError: TkPackage can't find package Tkhtml
> from /usr/local/lib/ruby/1.8/tk/package.rb:86:in `require'
> from /usr/local/lib/ruby/1.8/tkextlib/tkHTML/htmlwidget.rb:15
> from /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb:13
> from (irb):2
>
> Do you have tkHTML setup? Do you recall how you did it?
>
> Randy Kramer
>
>
>


Can't say that I do, I just have slightly more experience with
setting things up with setup.rb apparently

It looks like the ruby files are there, but the Tcl/Tk files are
missing (or unable to be found).




 
Reply With Quote
 
Randy Kramer
Guest
Posts: n/a
 
      03-26-2006
On Saturday 25 March 2006 09:50 pm, Logan Capaldo wrote:
> On Mar 25, 2006, at 5:01 PM, Randy Kramer wrote:
> > still the same problem with the require 'tkextlib/tkHTML':
> >
> > RuntimeError: TkPackage can't find package Tkhtml
> > from /usr/local/lib/ruby/1.8/tk/package.rb:86:in `require'
> > from /usr/local/lib/ruby/1.8/tkextlib/tkHTML/htmlwidget.rb:15
> > from /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb:13
> > from (irb):2
> >
> > Do you have tkHTML setup? Do you recall how you did it?


> Can't say that I do, I just have slightly more experience with
> setting things up with setup.rb apparently
>
> It looks like the ruby files are there, but the Tcl/Tk files are
> missing (or unable to be found).


Thanks! I'll have to think about the idea/possibility that the Tcl/Tk files
are missing--I'm pretty sure tcl is installed:

[root@s14 python]# rpm -q tcl
tcl-8.4.11-1mdk
[root@s14 doc]# rpm -V tcl-8.4.11-1mdk
[root@s14 doc]#

One reason for writing at the moment is that I noticed that a tkhtml.so file
comes with (or can come with) the tkhtml package(s), and I haven't installed
that anywhere. Should I? Where? (Maybe those are the Tcl/Tk files that are
missing??)

Randy Kramer


 
Reply With Quote
 
Randy Kramer
Guest
Posts: n/a
 
      03-26-2006
On Sunday 26 March 2006 02:35 pm, Randy Kramer wrote:
> On Saturday 25 March 2006 09:50 pm, Logan Capaldo wrote:
> > On Mar 25, 2006, at 5:01 PM, Randy Kramer wrote:
> > > still the same problem with the require 'tkextlib/tkHTML':
> > >
> > > RuntimeError: TkPackage can't find package Tkhtml
> > > from /usr/local/lib/ruby/1.8/tk/package.rb:86:in `require'
> > > from /usr/local/lib/ruby/1.8/tkextlib/tkHTML/htmlwidget.rb:15
> > > from /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb:13
> > > from (irb):2
> > >
> > > Do you have tkHTML setup? Do you recall how you did it?

> >
> > Can't say that I do, I just have slightly more experience with
> > setting things up with setup.rb apparently
> >
> > It looks like the ruby files are there, but the Tcl/Tk files are
> > missing (or unable to be found).

>
> Thanks! I'll have to think about the idea/possibility that the Tcl/Tk
> files are missing--I'm pretty sure tcl is installed:
>
> [root@s14 python]# rpm -q tcl
> tcl-8.4.11-1mdk
> [root@s14 doc]# rpm -V tcl-8.4.11-1mdk
> [root@s14 doc]#


PS: Another thing reinforcing my belief that the tk files are there is that a
few days ago I ran a sample program that used tk--the program created a
stopwatch with a display in a tk "window".

> One reason for writing at the moment is that I noticed that a tkhtml.so
> file comes with (or can come with) the tkhtml package(s), and I haven't
> installed that anywhere. Should I? Where? (Maybe those are the Tcl/Tk
> files that are missing??)
>
> Randy Kramer



 
Reply With Quote
 
Logan Capaldo
Guest
Posts: n/a
 
      03-26-2006

On Mar 26, 2006, at 3:05 PM, Randy Kramer wrote:

> On Sunday 26 March 2006 02:35 pm, Randy Kramer wrote:
>> On Saturday 25 March 2006 09:50 pm, Logan Capaldo wrote:
>>> On Mar 25, 2006, at 5:01 PM, Randy Kramer wrote:
>>>> still the same problem with the require 'tkextlib/tkHTML':
>>>>
>>>> RuntimeError: TkPackage can't find package Tkhtml
>>>> from /usr/local/lib/ruby/1.8/tk/package.rb:86:in `require'
>>>> from /usr/local/lib/ruby/1.8/tkextlib/tkHTML/
>>>> htmlwidget.rb:15
>>>> from /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb:13
>>>> from (irb):2
>>>>
>>>> Do you have tkHTML setup? Do you recall how you did it?
>>>
>>> Can't say that I do, I just have slightly more experience with
>>> setting things up with setup.rb apparently
>>>
>>> It looks like the ruby files are there, but the Tcl/Tk files are
>>> missing (or unable to be found).

>>
>> Thanks! I'll have to think about the idea/possibility that the
>> Tcl/Tk
>> files are missing--I'm pretty sure tcl is installed:
>>
>> [root@s14 python]# rpm -q tcl
>> tcl-8.4.11-1mdk
>> [root@s14 doc]# rpm -V tcl-8.4.11-1mdk
>> [root@s14 doc]#

>
> PS: Another thing reinforcing my belief that the tk files are there
> is that a
> few days ago I ran a sample program that used tk--the program
> created a
> stopwatch with a display in a tk "window".
>
>> One reason for writing at the moment is that I noticed that a
>> tkhtml.so
>> file comes with (or can come with) the tkhtml package(s), and I
>> haven't
>> installed that anywhere. Should I? Where? (Maybe those are the
>> Tcl/Tk
>> files that are missing??)
>>
>> Randy Kramer

>


I was thinking more along the lines of TkHTML specifically, not any
and all Tcl/Tk files. I would suggest that installing the tkhtml.so
file in its proper place should do the trick. Try and find a README
or INSTALL file in the source distribution.



 
Reply With Quote
 
Hidetoshi NAGAI
Guest
Posts: n/a
 
      03-27-2006
From: Randy Kramer <(E-Mail Removed)>
Subject: Help with tkHTML (specifically, require 'tkextlib/tkHTML' fails to find package)
Date: Sun, 26 Mar 2006 06:01:44 +0900
Message-ID: <(E-Mail Removed)>
> It fails at the step =require 'tkextlib/tkHTML'= with a message:
>
> RuntimeError: TkPackage can't find package Tkhtml
> from /usr/local/lib/ruby/1.8/tk/package.rb:86:in `require'
> from /usr/local/lib/ruby/1.8/tkextlib/tkHTML/htmlwidget.rb:15
> from /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb:13
> from (irb):2
>
> What I've done (generally):
>
> I may have confused the issue, because I've downloaded and installed both
> ActiveTCL and the standalone ktHTML packages. I installed the ktHTML package
> first, and tried the example before installing ActiveTCL, but got the same
> result.


I think that your tcltklib.so doesn't load ActiveTcl library.
Please run "/usr/local/bin/ruby -r tk -e 'p Tk::TCL_LIBRARY'".
Probably, it shows the path your original (not ActiveTcl) Tcl/Tk directory.

You may control the path with LD_LIBRARY_PATH or TCL_LIBRARY environment
variable. For example, "TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.4 /usr/local/bin/ruby -r tk -e 'p Tk::TCL_LIBRARY'".

You can get the support status of Tk extensions on your environment
by "/usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb".
Possibly, you get different result between
"/usr/local/bin/ruby /usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb"
and
"TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.4 /usr/local/bin/ruby /usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb".
--
Hidetoshi NAGAI ((E-Mail Removed))


 
Reply With Quote
 
Randy Kramer
Guest
Posts: n/a
 
      03-27-2006
Everyone: I'm still not there, any suggestions appreciated.

Hidetoshi NAGAI,

Thanks very much for your help so far! As you can see (from the comments
interspersed with yours, below) I'm probably out of my depth here, and I
don't want to waste a lot of your time. Maybe I should delete (uninstall)
Ruby, ActiveTCL, and the ktHTML packages and reinstall?

If I do that, I'd prefer not to reinstall ActiveTCL (just because of the size
of it) and install only Ruby and the ktHTML package. I can't immediately
recall/find from where I downloaded the ktHTML package, there is no version
number on the package, and the dates on the files are now (of course) the
dates I downloaded the files, not the original dates.

The size of the tkhtml.tar.gz is 387987 bytes, and the first lines of the
spec.html file are:

"This is a draft interface specification for the Tk HTML widget currently
under development. Since it is still a draft, it is subject to change.
Eventually, the interface will stabilize and this interface specification
will morph into a manual page."

My question is, is that the latest version, or is the version in ActiveTCL
more up-to-date?

Below (interspersed with your suggestions) are the things I've tried and the
results--perhaps you or somebody else can see what I've done wrong. (Or, at
some time in the fairly near future, I'll uninstall Ruby, etc., and start
again--it may be a week or two as I have some other things to deal with in
the next week or so.)

On Sunday 26 March 2006 09:58 pm, Hidetoshi NAGAI wrote:
> I think that your tcltklib.so doesn't load ActiveTcl library.
> Please run "/usr/local/bin/ruby -r tk -e 'p Tk::TCL_LIBRARY'".
> Probably, it shows the path your original (not ActiveTcl) Tcl/Tk directory.


Yes, it shows "/usr/lib/tcl8.4"

> You may control the path with LD_LIBRARY_PATH or TCL_LIBRARY environment
> variable. For example, "TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.4
> /usr/local/bin/ruby -r tk -e 'p Tk::TCL_LIBRARY'".


That didn't seem to do anything the first time I tried it, now going back to
try again and check various things:

* I now see the following in my environment--is that what I should see?

[rhk@s14 tkHTML]$ set | grep LIBRARY
_='p Tk::TCL_LIBRARY'

* I installed ActiveTcl 8.5, so I believe the path I should use
is /usr/local/ActiveTcl/lib/tcl8.5. It exists, and contains some .tcl files
(e.g., auto.tcl) and subdirectories (e.g., opt0.4).

* Now I run
[rhk@s14 tkHTML]$
TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.5 /usr/local/bin/ruby -r tk -e 'p
Tk::TCL_LIBRARY'

and get: "/usr/lib/tcl8.4" which looks the same as before. Is that what I
should get?

Earlier (on the first try) I tried running irb and got no better results for
the require 'tclextlib/tkHTML' statement, but I now realize I should run irb
something like this:

TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.5 /usr/local/bin/irb

Let's see how that works--nope, still the same problem:

[rhk@s14 rhk]$ TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.5 /usr/local/bin/irb
irb(main):001:0> require 'tk'
=> true
irb(main):002:0> require 'tkextlib/tkHTML'
RuntimeError: TkPackage can't find package Tkhtml
from /usr/local/lib/ruby/1.8/tk/package.rb:86:in `require'
from /usr/local/lib/ruby/1.8/tkextlib/tkHTML/htmlwidget.rb:15
from /usr/local/lib/ruby/1.8/tkextlib/tkHTML.rb:13
from (irb):2

> You can get the support status of Tk extensions on your environment
> by "/usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb".


That seems useful (now and in the future). Among other things, I see:

*LACK : tkHTML.rb : require->{}
FAIL->[["tkextlib/tkHTML/htmlwidget", :require_ruby_lib]]
*LACK : tkHTML/htmlwidget.rb : require->{} FAIL->[["Tkhtml", ackage]]
Ready : tkHTML/setup.rb : require->{}

(And maybe half of the packages that scroll by are marked Ready and the other
half marked LACK (just a guess). I'm guessing that Ready means I'm good to
go, and LACK means there is a problem.)

> Possibly, you get different result between
> "/usr/local/bin/ruby /usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb"
> and
> "TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.4 /usr/local/bin/ruby
> /usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb". --


Nope, they seem the same.

<My "notes", showing more detail--I think you can ignore these>
The results for tkHTML seem the same:

[rhk@s14 tkHTML]$
TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.5 /usr/local/bin/ruby /usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb
| grep tkHTML
*LACK : tkHTML.rb : require->{}
FAIL->[["tkextlib/tkHTML/htmlwidget", :require_ruby_lib]]
*LACK : tkHTML/htmlwidget.rb : require->{} FAIL->[["Tkhtml", ackage]]
Ready : tkHTML/setup.rb : require->{}

[rhk@s14 tkHTML]$
TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.5 /usr/local/bin/ruby /usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb
| wc
253 1313 12046

[rhk@s14 tkHTML]$ /usr/local/lib/ruby/1.8/tkextlib/pkg_checker.rb | wc
253 1313 12046
</My "notes", showing more detail--I think you can ignore these>

Ok, maybe because tkHTML/setup.rb is ready, I should try running that, with
the TCL_LIBRARY path prefix:

[rhk@s14 tkHTML]$
TCL_LIBRARY=/usr/local/ActiveTcl/lib/tcl8.5 /usr/local/bin/ruby /usr/local/lib/ruby/1.8/tkextlib/tkHTML/setup.rb

And then retry pkg_checker--no, no change in the output listed previously
(with or without the TCL_LIBRARY prefix):

*LACK : tkHTML.rb : require->{}
FAIL->[["tkextlib/tkHTML/htmlwidget", :require_ruby_lib]]
*LACK : tkHTML/htmlwidget.rb : require->{} FAIL->[["Tkhtml", ackage]]
Ready : tkHTML/setup.rb : require->{}

Randy Kramer






 
Reply With Quote
 
Randy Kramer
Guest
Posts: n/a
 
      03-27-2006
On Monday 27 March 2006 10:37 am, Randy Kramer wrote:
> If I do that, I'd prefer not to reinstall ActiveTCL (just because of the
> size of it) and install only Ruby and the ktHTML package. I can't
> immediately recall/find from where I downloaded the ktHTML package, there
> is no version number on the package, and the dates on the files are now (of
> course) the dates I downloaded the files, not the original dates.


Ok, I just found the page where I downloaded the ktHTML packages from:

http://www.hwaci.com/sw/tkhtml/download.html:

"TkHtml Download Page
Last update: Mon Jul 31 06:34:47 EDT 2000"

"tkhtml.tar.gz
Description: A tarball containing all the latest source code
Size: 387987 bytes
Last modified: Tue Jun 20 20:47:11 EDT 2000"

It looks rather old--I should probably look for something more up-to-date--are
the only options the ActiveTCL package or CVS?

Randy Kramer


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ruby-1.9.1: require 'rio' fails Wybo Dekker Ruby 9 12-03-2009 08:33 PM
gem query finds gem, yet require fails Michael Glaesemann Ruby 5 11-26-2006 02:23 AM
require 'yaml' fails Bucco Ruby 1 05-29-2006 03:28 PM
TkHTML progress, additional questions Randy Kramer Ruby 0 04-03-2006 04:03 PM
[RubyGems] require fails the first time called and works the second time Brian Takita Ruby 2 07-25-2005 04:56 PM



Advertisments