Tk on Snow Leopard

D

Dudebot

Sorry about posting an OS specific question here, but the Apple
support discussion groups seem to think this is a problem with Tk
bindings in Ruby, not with Snow Leopard. Makes no sense to me, but
whatever.

I've used Tk as my go-to GUI for Ruby for years, and love it. In
Leopard (10.5) Tk bindings worked, in Snow Leopard (10.6) I get this
error if I try to run a script with "require tk"

LoadError: no such file to load =97 tk

Does anyone know a good workaround? Has anyone had success getting tk
bindings to work in 10.6, e.g. with MacPorts? I haven't tried that
approach--I wanted to find out others experience before I went through
that.

Frankly, I wish that I could replace MacOS with Linux on this hardware
(I mean replace, not run a vm) but I digress.

TIA,
Craig
 
R

Ryan Davis

Sorry about posting an OS specific question here, but the Apple
support discussion groups seem to think this is a problem with Tk
bindings in Ruby, not with Snow Leopard. Makes no sense to me, but
whatever.

I've used Tk as my go-to GUI for Ruby for years, and love it. In
Leopard (10.5) Tk bindings worked, in Snow Leopard (10.6) I get this
error if I try to run a script with "require tk"

LoadError: no such file to load =97 tk

Does anyone know a good workaround? Has anyone had success getting tk
bindings to work in 10.6, e.g. with MacPorts? I haven't tried that
approach--I wanted to find out others experience before I went through
that.

Sure enough, it looks like apple didn't ship the tk extension:

511 % find /System/Library/Frameworks/Ruby.framework/Versions/Current -=20=

name tk.rb
512 %

The obvious workaround is to build and install your own ruby (either =20
yourself or via macports). That requires having the developer tools =20
installed so you have a C compiler. By default ruby will install into /=20=

usr/local/ (/opt/local if macports) and that won't be in your path. =20
You'll need to either add it BEFORE /usr/bin so the stock ruby gets =20
overridden or rename the stock ruby.
 
D

Dudebot

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top