Forum: Ruby Which GEM to instal for TK?

0fa73332c8e4a3b06ea439fd3f034322?d=identicon&s=25 Ronald Fischer (rovf)
on 2013-10-29 16:35
I have Ruby 1.8.6 and gem 1.3.4 both on SUSE Linux and on Mac OSX 10.4
(Tiger). Both seemingly don't have the 'tk' module:

require 'tk'
LoadError: no such file to load -- tk

Which gem do I need to install for getting Tk? I tried

gem install tk

but no such gem was found.
Abdb670e1c130f96f947a94d03c02efa?d=identicon&s=25 Eric Christopherson (echristopherson)
on 2013-10-29 17:03
(Received via mailing list)
I haven't used this in several years, but the tk_as_gem gem used to work
to
add Tk to an existing Ruby.

(It would be advisable to just upgrade to a newer Ruby; they general
have
Tk included.)
39ca2d7a2722504ac2a7e9d70d3c2455?d=identicon&s=25 Michel (Guest)
on 2013-10-29 17:24
(Received via mailing list)
I got it from the Fedora repository, perhaps you may also get it from
the Suse repository.
The package name was ruby-tcltk-1.8.6.....
Hope this help.
15000f55138ae94b0f362ed7c625461a?d=identicon&s=25 unknown (Guest)
on 2013-10-29 18:13
(Received via mailing list)
Am 29.10.2013 16:35, schrieb Ronald Fischer:
> I have Ruby 1.8.6 and gem 1.3.4 both on SUSE Linux and on Mac OSX 10.4
> (Tiger). Both seemingly don't have the 'tk' module:

On a side note: 1.8.6 is **really** outdated, and unless you have
a very good reason you shouldn't use it anymore and switch to 1.9.3
or 2.0.0. (Even 1.8.7 is not longer supported by the Ruby core team.)

> require 'tk'
> LoadError: no such file to load -- tk
>
> Which gem do I need to install for getting Tk? I tried
>
> gem install tk
>
> but no such gem was found.

On Ubuntu, there is a libtcltk-ruby package, there might be something
similar for SuSE.

Regards,
Marcus
0fa73332c8e4a3b06ea439fd3f034322?d=identicon&s=25 Ronald Fischer (rovf)
on 2013-10-30 10:42
unknown wrote in post #1126034:
> Am 29.10.2013 16:35, schrieb Ronald Fischer:
>> I have Ruby 1.8.6 and gem 1.3.4 both on SUSE Linux and on Mac OSX 10.4
>> (Tiger). Both seemingly don't have the 'tk' module:
>
> On a side note: 1.8.6 is **really** outdated, and unless you have
> a very good reason you shouldn't use it anymore and switch to 1.9.3
> or 2.0.0. (Even 1.8.7 is not longer supported by the Ruby core team.)

I would like to switch too, but from what I know, the later versions
don't run on OSX 10.4.

Maybe they can be ported, but the one-click installer (which *is* very
convenient to use) only offers 1.8.6 for this platform.

Ronald
0fa73332c8e4a3b06ea439fd3f034322?d=identicon&s=25 Ronald Fischer (rovf)
on 2013-10-30 11:01
Eric Christopherson wrote in post #1126028:
> I haven't used this in several years, but the tk_as_gem gem used to work
> to
> add Tk to an existing Ruby.

Indeed, the gem exists, but installation fails:

tcltklib.c: In function 'lib_eventloop_core':
tcltklib.c:1995: error: 'CHECK_INTS' undeclared (first use in this
function)

(same error on Linux and Mac). Seems that the implementation is broken.
The code part in question looks a bit like unfinished work:

#ifdef RUBY_USE_NATIVE_THREAD
        /* if (update_flag == 0) CHECK_INTS; */ /*XXXXXXXXXXXXX  TODO
!!!! */
#else
        if (update_flag == 0) CHECK_INTS;
#endif

Actually, CHECK_INTS isn't defined anywhere, so I guess tests had been
usually done with RUBY_USE_NATIVE_THREAD being set and the error did not
show up.

I wonder whether it is safe to just remove this section from the code.
Or should I for the safe side contact the supporters of this gem?
15000f55138ae94b0f362ed7c625461a?d=identicon&s=25 unknown (Guest)
on 2013-10-30 11:02
(Received via mailing list)
Am 30.10.2013 10:42, schrieb Ronald Fischer:
> don't run on OSX 10.4.
>
> Maybe they can be ported, but the one-click installer (which *is* very
> convenient to use) only offers 1.8.6 for this platform.
>
> Ronald

I do not really know anything about OS X, but I'm pretty sure
newer versions should work. I guess commonly used tools like RVM
or homebrew(?) might help.

Regards,
Marcus
0fa73332c8e4a3b06ea439fd3f034322?d=identicon&s=25 Ronald Fischer (rovf)
on 2013-10-30 11:56
unknown wrote in post #1126077:
> Am 30.10.2013 10:42, schrieb Ronald Fischer:
>> don't run on OSX 10.4.
>>
>> Maybe they can be ported, but the one-click installer (which *is* very
>> convenient to use) only offers 1.8.6 for this platform.
>>
>> Ronald
>
> I do not really know anything about OS X, but I'm pretty sure
> newer versions should work. I guess commonly used tools like RVM
> or homebrew(?) might help.

Homebrew unfortunately doesn't run on OSX 10.4.

As for rvm, I don't know yet whether it will work, but getting it
running, will be a non-trivial effort. I would have to install a newer
bash version first, which is required by rvm, and also git and
subversion, and with all of this, it is not clear whether I can find a
version which is new enough for rvm, but still supported on my OSX.

Ronald
6e366eb5a71be2bad7f383d42aeb4788?d=identicon&s=25 Justin Collins (Guest)
on 2013-10-30 20:13
(Received via mailing list)
On 10/29/2013 08:35 AM, Ronald Fischer wrote:
> but no such gem was found.
>

Maybe you should try ActiveTk:
http://www.activestate.com/activetcl/downloads

There may be a version old enough for you.

-Justin
0fa73332c8e4a3b06ea439fd3f034322?d=identicon&s=25 Ronald Fischer (rovf)
on 2013-10-30 22:32
Justin Collins wrote in post #1126116:
> On 10/29/2013 08:35 AM, Ronald Fischer wrote:
> Maybe you should try ActiveTk:
> http://www.activestate.com/activetcl/downloads
>
> There may be a version old enough for you.

There *might* be, but not free. ActiveState has the interesting price
policy, that they hand out the newer versions for free, but for the
older versions we have to pay a pretty steep price (999 US$ per user per
year).

BTW, I don't think that the problem is a missing Tk version on my
systems. On the Mac, I can happily use Python with tkinter (which is
their Tk binding), and on my Linux system I can run wish. The problem is
the interface from Ruby to Tk.
6e366eb5a71be2bad7f383d42aeb4788?d=identicon&s=25 Justin Collins (Guest)
on 2013-10-30 22:40
(Received via mailing list)
On 10/30/2013 02:32 PM, Ronald Fischer wrote:
> year).
>
> BTW, I don't think that the problem is a missing Tk version on my
> systems. On the Mac, I can happily use Python with tkinter (which is
> their Tk binding), and on my Linux system I can run wish. The problem is
> the interface from Ruby to Tk.
>

Oh then you should check out http://rdoc.info/stdlib/tk/

You might just need to adjust the Tk load path Ruby uses.

-Justin
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.