J
James Calivar
Hello,
I'm trying to run a very simple Ruby script that employs Tk:
## BEGIN FILE ##
require 'tk'
root = TkRoot.new {title "File to Open"}
TkLabel.new(root) do
text 'Please enter the name of a file to open: '
pack('padx' => 15, 'pady' => 15, 'side' => 'left')
end
Tk.mainloop
## END FILE ##
Unfortunately I get the following error when it atempts to execute:
"C:\ruby\sample\james>ruby tk_test.rb
tk_test.rb:1:in `require': no such file to load -- tk (LoadError)
from tk_test.rb:1"
Can anyone help? I am using Ruby 1.8.4 which I compiled myself using
cygwin32. I am running on XP. I've edited the Setup file in
C:\ruby\ext\Setup to enable the tcltklib and tk lines, rebuilt, and
still no go.
Interestingly, I had the same problem with the extension "WIN32OLE"
earlier yesterday, but after I copied over some lines from some sample
files, it started to work (which bugs me because my file was verbatim,
unless there was some hidden chars that I was missing or something
weird like that). I had previously rebuilt after altering the
C:\ruby\ext\Setup file to enable Win32API and win32ole, but that didn't
work until I copied over the sample file.
Thanks in advance,
James
I'm trying to run a very simple Ruby script that employs Tk:
## BEGIN FILE ##
require 'tk'
root = TkRoot.new {title "File to Open"}
TkLabel.new(root) do
text 'Please enter the name of a file to open: '
pack('padx' => 15, 'pady' => 15, 'side' => 'left')
end
Tk.mainloop
## END FILE ##
Unfortunately I get the following error when it atempts to execute:
"C:\ruby\sample\james>ruby tk_test.rb
tk_test.rb:1:in `require': no such file to load -- tk (LoadError)
from tk_test.rb:1"
Can anyone help? I am using Ruby 1.8.4 which I compiled myself using
cygwin32. I am running on XP. I've edited the Setup file in
C:\ruby\ext\Setup to enable the tcltklib and tk lines, rebuilt, and
still no go.
Interestingly, I had the same problem with the extension "WIN32OLE"
earlier yesterday, but after I copied over some lines from some sample
files, it started to work (which bugs me because my file was verbatim,
unless there was some hidden chars that I was missing or something
weird like that). I had previously rebuilt after altering the
C:\ruby\ext\Setup file to enable Win32API and win32ole, but that didn't
work until I copied over the sample file.
Thanks in advance,
James