well, i’m eager to try out gtk2 1.0, but i still get errors trying to
install - not sure what the problem is. here’s what i get with a fresh
install of 1.9.2 patch 180 under rvm on ubuntu 10.4 lucid:
jk@jk-laptop:~$ rvm use 1.9.2
Using /home/jk/.rvm/gems/ruby-1.9.2-p180
jk@jk-laptop:~$ gem install -r gtk2
Fetching: glib2-1.0.0.gem (100%)
Building native extensions. This could take a while…
Fetching: atk-1.0.0.gem (100%)
Building native extensions. This could take a while…
Fetching: pango-1.0.0.gem (100%)
Building native extensions. This could take a while…
Fetching: gdk_pixbuf2-1.0.0.gem (100%)
Building native extensions. This could take a while…
Fetching: gtk2-1.0.0.gem (100%)
Building native extensions. This could take a while…
Successfully installed glib2-1.0.0
Successfully installed atk-1.0.0
Successfully installed pango-1.0.0
Successfully installed gdk_pixbuf2-1.0.0
Successfully installed gtk2-1.0.0
5 gems installed
Installing ri documentation for glib2-1.0.0…
Installing ri documentation for atk-1.0.0…
Installing ri documentation for pango-1.0.0…
Installing ri documentation for gdk_pixbuf2-1.0.0…
Installing ri documentation for gtk2-1.0.0…
Installing RDoc documentation for glib2-1.0.0…
Installing RDoc documentation for atk-1.0.0…
Installing RDoc documentation for pango-1.0.0…
Installing RDoc documentation for gdk_pixbuf2-1.0.0…
Installing RDoc documentation for gtk2-1.0.0…
jk@jk-laptop:~$ irb
ruby-1.9.2-p180 :001 > require ‘gtk2’
NameError: uninitialized constant Gdk::Drawable
from
/home/jk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /home/jk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from
/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/gtk2-1.0.0/lib/gtk2/base.rb:25:in rescue in <top (required)>' from /home/jk/.rvm/gems/ruby-1.9.2-p180/gems/gtk2-1.0.0/lib/gtk2/base.rb:21:in<top (required)>’
from
/home/jk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /home/jk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire’
from
/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/gtk2-1.0.0/lib/gtk2.rb:11:in <top (required)>' from /home/jk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:58:inrequire’
from
/home/jk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:58:in rescue in require' from /home/jk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:inrequire’
from (irb):1
from /home/jk/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `’
any ideas what the problem is? i’d really like to try it out, but i
can’t seem to install gtk except version 0.19.3 through my package
manager.
thanks for the input. must have had cairo already installed… i
wiped out all the gems and started from scratch - gems install just
fine, but i get an error installing the ri documentation for cairo:
$ rvm use 1.9.2
Using /home/jk/.rvm/gems/ruby-1.9.2-p180
$ gem install -r gtk2
Fetching: pkg-config-1.1.2.gem (100%)
Fetching: glib2-1.0.0.gem (100%)
Building native extensions. This could take a while…
Fetching: atk-1.0.0.gem (100%)
Building native extensions. This could take a while…
Fetching: cairo-1.10.0.gem (100%)
Building native extensions. This could take a while…
Fetching: pango-1.0.0.gem (100%)
Building native extensions. This could take a while…
Fetching: gdk_pixbuf2-1.0.0.gem (100%)
Building native extensions. This could take a while…
Fetching: gtk2-1.0.0.gem (100%)
Building native extensions. This could take a while…
Successfully installed pkg-config-1.1.2
Successfully installed glib2-1.0.0
Successfully installed atk-1.0.0
Successfully installed cairo-1.10.0
Successfully installed pango-1.0.0
Successfully installed gdk_pixbuf2-1.0.0
Successfully installed gtk2-1.0.0
7 gems installed
Installing ri documentation for pkg-config-1.1.2…
Installing ri documentation for glib2-1.0.0…
Installing ri documentation for atk-1.0.0…
Installing ri documentation for cairo-1.10.0…
RDoc::Parser::Ruby failure around line 131 of
lib/cairo.rb
Before reporting this, could you check that the file you’re documenting
compiles cleanly–RDoc is not a full Ruby parser, and gets confused
easily if
fed invalid programs.
Can you check which files were loaded after requiring gtk2?
Maybe the so file is loaded instead of the rb one.
hi Vincent -
not sure how to go about checking that…
this line of the error:
/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/gtk2-1.0.0/lib/gtk2.rb:11:in
`<top (required)>’
…leads me to the directory indicated, where i find both a gtk2.rb
file, and gtk2.so - am i on the right track? if so, any ideas about how
i can check which is being loaded?
here’s a list of what i think are the pertinent files loaded after
requiring gtk2:
…
…
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/glib2-1.0.0/lib/glib2.so”
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/glib2-1.0.0/lib/glib2.rb”
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/atk-1.0.0/lib/atk.so”
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/atk-1.0.0/lib/atk.rb”
…cairo stuff
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/cairo-1.10.0/lib/cairo.so”
…cairo stuff
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/cairo-1.10.0/lib/cairo.rb”
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/pango-1.0.0/lib/pango.so”
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/pango-1.0.0/lib/pango.rb”
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/gdk_pixbuf2-1.0.0/lib/gdk_pixbuf2.so”
“/home/jk/.rvm/gems/ruby-1.9.2-p180/gems/gdk_pixbuf2-1.0.0/lib/gdk_pixbuf2.rb”
i don’t see anything loaded for gtk2 (neither .rb, nor .so,) though my
gem list shows it as installed. i imagine this is because the require
failed, and gtk2 was never loaded?