Ruby/Tk?

K

Kent Loobey

I am brand new to Ruby. I am trying to get my system set up so that I can use
Tk in Ruby.

I get an error when I try to use Tk:

kent@moe:~/projects/ruby/t1$ ./t1.rb
/t1.rb:3:in `require': No such file to load -- tk (LoadError)
from ./t1.rb:3
kent@moe:~/projects/ruby/t1$ cat t1.rb
#!/usr/bin/ruby

require 'tk'

root = TkRoot.new { title "Ex1" }
TkLabel.new(root) {
text 'Hello, World!'
pack { padx 15; pady 15; side 'left' }
}
Tk.mainloopkent@moe:~/projects/ruby/t1$

I am not sure how I get what ever Ruby is looking for. I have tk8.4 on my
system.
 
K

Kent Loobey

Okay, I got it to work.

I am brand new to Ruby. I am trying to get my system set up so that I can
use Tk in Ruby.

I get an error when I try to use Tk:

kent@moe:~/projects/ruby/t1$ ./t1.rb
./t1.rb:3:in `require': No such file to load -- tk (LoadError)
from ./t1.rb:3
kent@moe:~/projects/ruby/t1$ cat t1.rb
#!/usr/bin/ruby

require 'tk'

root = TkRoot.new { title "Ex1" }
TkLabel.new(root) {
text 'Hello, World!'
pack { padx 15; pady 15; side 'left' }
}
Tk.mainloopkent@moe:~/projects/ruby/t1$

I am not sure how I get what ever Ruby is looking for. I have tk8.4 on my
system.
 

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,981
Messages
2,570,188
Members
46,733
Latest member
LonaMonzon

Latest Threads

Top