# Ruby and glade/gtk+

**URL:** <https://www.ruby-forum.com/t/ruby-and-glade-gtk/187893>\
**Category:** Ruby-Gnome 2\
**Created:** [May 1, 2010, 1:28am UTC](https://www.ruby-forum.com/t/ruby-and-glade-gtk/187893 "2010-05-01T01:28:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rorra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rorra](https://www.ruby-forum.com/u/rorra)\
**Post date:** [May 1, 2010, 1:28am UTC](https://www.ruby-forum.com/t/ruby-and-glade-gtk/187893/1 "2010-05-01T01:28:51Z")

</div>

Hi, well i’m going to explain my problem.

# RUBY

I’m a windows user, but i want to program on ruby 1.9, there wasn’t a  
msi installer so i downloaded the binaries (Ruby 1.9.1-p129-i386 Binary)  
and put it on “C:”, then i modified the path variable to the ruby/bin  
directory; then i tried a “hello world” with scite, pressed f5 and it  
works! 😃 (just like php).

# GLADE/GTK

Then i donwloaded the msi installer for glade 3.6.7 and gtk+ both came  
in one msi installer, no need to correct path variable i guess, then i  
install it on “C:”, i want this versions because i’ve heard that  
libglade is deprecated, now gtkbuilder rules, well, glade runs ok.

# PROBLEM

i don’t know what is missing, because i tried some code from internet  
calling a simple window and returns this error:

in `require’: no such file to load – Gtk (LoadError)

this is the code:

require ‘Gtk’

window = Gtk::Window.new(Gtk::WINDOW\_TOPLEVEL)  
button = Gtk::Button.new(“Hello World”)

window.set\_title(“Hello Ruby”)  
window.border\_width(10)

# Connect the button to a callback.

button.signal\_connect(‘clicked’) { puts “Hello Ruby” }

# Connect the signals ‘delete\_event’ and ‘destroy’

window.signal\_connect(‘delete\_event’) {  
puts “delete\_event received”  
false  
}  
window.signal\_connect(‘destroy’) {  
puts “destroy event received”  
Gtk.main\_quit  
}

window.add button  
window.show\_all  
Gtk.main

Please help, thank you

---

<div class="post-metadata">

**Author:** ![rorra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rorra](https://www.ruby-forum.com/u/rorra)\
**Post date:** [May 1, 2010, 8:28am UTC](https://www.ruby-forum.com/t/ruby-and-glade-gtk/187893/2 "2010-05-01T08:28:06Z")

</div>

Subject: [ruby-gnome2-devel-en] ruby and glade/gtk+  
Date: sab 01 mag 10 01:28:51 +0200

Quoting Rodrigo Durá ([removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)):

> require ‘Gtk’  
> I am not a windows user, but in my linux code I have to write

require ‘gtk2’

(note the lowercase g and the 2 at end)

I believe this should be the case for windows, too.

HTH

Carlo

–

- 

```
    Se la Strada e la sua Virtu' non fossero state messe da 

```

parte,

- K \* Carlo E. Prelz - [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)
