from tk.rb:1:in `require’
Obviously Ruby’s Tk wrapper isn’t finding the library.
Did you install Ruby on the Mac yourself?
Which version of Mac OS X have you?
I don’t know if it matters but I can run the following command without
What do I do? Do I install tk as a gem?
First try the Tcl shell with Tk built in, it’s called ‘wish’.
Paste this into wish (or put it in a file e.g. called ‘hello’, and
execute ‘wish hello’):
button .b -text “Hello, world!” -command exit
You should get a small window with a 'Hello, world" button.
On my Mac OS X 10.4, the pre-installed Ruby works with Tk (which is
also installed), so …
Can you revert to the version that came pre-installed on the Mac
(/usr/bin/ruby) and try the little ‘hello world’ example? That will
tell you if you have the right pieces installed, and if Tk is able to
This may be good enough for now, but if not, the build method
recommended by the Ruby on Rails book is at:
I haven’t tried that yet, but will will later today (I may need to use
different versions of Ruby for a project).