# Ruby/Tk?

**URL:** <https://rubytalk.org/t/ruby-tk/16754>\
**Category:** ruby-talk\
**Created:** [28 February 2005 21:07 UTC](https://rubytalk.org/t/ruby-tk/16754 "2005-02-28T21:07:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kent\_Loobey](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kent\_Loobey](https://rubytalk.org/u/Kent_Loobey)\
**Post date:** [28 February 2005 21:07 UTC](https://rubytalk.org/t/ruby-tk/16754/1 "2005-02-28T21:07:12Z")

</div>

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)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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) {  
&nbsp;&nbsp;text 'Hello, World!'  
&nbsp;&nbsp;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...

---

<div class="post-metadata">

**Author:** ![Kent\_Loobey](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kent\_Loobey](https://rubytalk.org/u/Kent_Loobey)\
**Post date:** [28 February 2005 21:47 UTC](https://rubytalk.org/t/ruby-tk/16754/2 "2005-02-28T21:47:04Z")

</div>

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)  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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) {  
> > &nbsp;&nbsp;text 'Hello, World!'  
> > &nbsp;&nbsp;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...
