Hello everyone,
when I try to run this sample program:
#!/usr/bin/ruby
# ZetCode Ruby GTK tutorial
#
# This program centers a window on
# the screen
#
# author: jan bodnar
# website: www.zetcode.com
# last modified: April 2009
require 'gtk2'
class RubyApp < Gtk::Window
def initialize
super
set_title "Center"
signal_connect "destroy" do
Gtk.main_quit
end
set_default_size 250, 200
set_window_position Gtk::Window::POS_CENTER
show
end
end
Gtk.init
window = RubyApp.new
Gtk.main
I get error :
/home/giovi/NetBeansProjects/center/lib/main.rb:12:in `require': no such
file to load -- gtk2 (LoadError)
from /home/giovi/NetBeansProjects/center/lib/main.rb:12
Does anyone now why? I looked up in Synaptic if package gtk2 is
installed
but I can not find it there.
Thanx for your help, regards
Giovanni
on 2011-01-11 19:34
on 2011-01-11 21:10
On Tue, 2011-01-11 at 19:34 +0100, Giovanni Alverà wrote: > file to load -- gtk2 (LoadError) > from /home/giovi/NetBeansProjects/center/lib/main.rb:12 > > Does anyone now why? I looked up in Synaptic if package gtk2 is > installed but I can not find it there. You probably need to install the 'libgtk2-ruby' package. Cheers Grant
on 2011-01-12 17:24
Grant McLean wrote in post #974023: > On Tue, 2011-01-11 at 19:34 +0100, Giovanni Alverà wrote: >> file to load -- gtk2 (LoadError) >> from /home/giovi/NetBeansProjects/center/lib/main.rb:12 >> >> Does anyone now why? I looked up in Synaptic if package gtk2 is >> installed but I can not find it there. > > You probably need to install the 'libgtk2-ruby' package. > > Cheers > Grant I looked at package 'libgtk2-ruby' with Synaptic and I already have it installed (libgtk2-ruby1.8). Thank you anyway :)
on 2011-01-12 17:26
Andrea Dallera wrote in post #974195: > Or, better, the gtk2 gem, with > > sudo gem install gtk2 > > Andrea Thank you Andrea, but when I type what you sad that's what I get.. giovi@ACERaspire5920G:~$ sudo gem install gtk2 [sudo] password for giovi: sudo: gem: command not found giovi@ACERaspire5920G:~$ confused :S
on 2011-01-12 18:03
I get a bit on with it. I uninstalled package ruby1.8 and installed ruby1.8-dev instead (the first one is missing a few important files as suggested in topic http://railsforum.com/viewtopic.php?id=22116) I then installed RubyGems (vers. 1.3.5) with Synaptic. I finally typed in a terminal: sudo gem install gtk2 and installation went fine. Anyway when I compile the program the error arises again.
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.