[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby/Tk?

Kent Loobey

2/28/2005 9:07:00 PM

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.

--
The Grape's Dilemma:
Awash in the vat of the universe, I am obsessed with desire to remain a
grape...


1 Answer

Kent Loobey

2/28/2005 9:47:00 PM

0

Okay, I got it to work.

On Monday 28 February 2005 01:07 pm, Kent Loobey wrote:
> 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.

--
The Grape's Dilemma:
Awash in the vat of the universe, I am obsessed with desire to remain a
grape...