# Install error - gtk2 on ubuntu natty (11.04)

**URL:** <https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535>\
**Category:** Ruby-Gnome 2\
**Created:** [April 8, 2011, 11:01am UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535 "2011-04-08T11:01:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [April 8, 2011, 11:01am UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/1 "2011-04-08T11:01:20Z")

</div>

Hi everyone,

I’ve tried to install gtk2 on ubuntu natty 11.04 but i receive an  
error  
during the installation:

(after sudo gem1.9.1 install gtk2)

checking for GCC… yes  
checking for rb\_define\_alloc\_func() in ruby.h… yes  
checking for rb\_block\_proc() in ruby.h… yes  
checking for new allocation framework… yes  
checking for attribute assignment… no  
checking for Win32 OS… no  
checking for gobject-2.0… no  
\*\*\* extconf.rb failed \*\*\*

gobject-2.0 seems to be missing though i’ve installed libgtk2.0-dev  
(which is  
supposed to install all the dependencies needed for building the native  
extensions). Has anybody tried to install the gtk2 gem on ubuntu 11.04?

Andrea

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [April 8, 2011, 2:08pm UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/2 "2011-04-08T14:08:30Z")

</div>

hi andrea -

well, i wish i had some answers for you - i’ve had problems installing  
the latest gtk2 on ubuntu 10.04 as well (there are several posts on this  
board about my troubles…)

for the moment i use the version that came with my package installer  
(0.19.3) and that works fine, though i’m missing some features from the  
newer version… does your package installer have a “libgtk2-ruby”  
package?

-j

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [April 8, 2011, 7:39pm UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/3 "2011-04-08T19:39:39Z")

</div>

2011/4/8 Andrea D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> gobject-2.0 seems to be missing though i’ve installed libgtk2.0-dev (which is  
> supposed to install all the dependencies needed for building the native  
> extensions). Has anybody tried to install the gtk2 gem on ubuntu 11.04?

Not yet.  
Does /usr/lib/pkgconfig/gobject-2.0.pc is present on your computer ?

–  
Vincent C.

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [April 27, 2011, 6:34am UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/4 "2011-04-27T06:34:08Z")

</div>

Looks like there is no way to use ruby gtk2 on ubuntu 11.04. I have  
tried all methods and have exhausted.

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [April 27, 2011, 8:48am UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/5 "2011-04-27T08:48:40Z")

</div>

On 27 April 2011 13:34, Karthikeyan A k  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Looks like there is no way to use ruby gtk2 on ubuntu 11.04. I have  
> tried all methods and have exhausted.

That’s good to know since I was just about to upgrade. Any ideas on  
what the problem is?

```
   MikeC

```

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [April 27, 2011, 4:53pm UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/6 "2011-04-27T16:53:21Z")

</div>

2011/4/8 Andrea D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> checking for new allocation framework… yes

I just tested to run “ruby extconf.rb” in glib2 directory on ubuntu  
11.04.  
I have the same error. I Install libglib2.0-dev package to resolve it.  
I can now build ruby-glib2 without errors.

libglib2.0-dev installs /usr/lib/pkgconfig/gobject-2.0.pc file that  
why I ask to check for it in a previous mail.

–  
Vincent C.

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [May 3, 2011, 1:28am UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/7 "2011-05-03T01:28:16Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Install error - gtk2 on ubuntu natty  
(11.04)” on Mon, 02 May 2011 21:16:49 +0200,  
“Andrea B.C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Installing libglib2.0-dev didn’t work on my 11.04 Ubuntu machine. It  
> turns out that on Natty some .pc files (including gobject-2.0.pc) are  
> placed in /usr/lib/i386-linux-gnu/pkgconfig instead of  
> /usr/lib/pkgconfig; thus I solved the problem by following these steps:

I’ve added /usr/lib/i386-linux-gnu/pkgconfig to the default  
.pc search path in pkg-config.gem and released  
it. (pkg-config gem 1.1.1 is the latest version.)

Please try again.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [May 4, 2011, 6:33pm UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/8 "2011-05-04T18:33:17Z")

</div>

Hi Kou,

Kouhei S. wrote in post #996305:

> Hi,
> 
> In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> “Re: [ruby-gnome2-devel-en] Install error - gtk2 on ubuntu natty  
> (11.04)” on Mon, 02 May 2011 21:16:49 +0200,  
> “Andrea B.C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Installing libglib2.0-dev didn’t work on my 11.04 Ubuntu machine. It  
> > turns out that on Natty some .pc files (including gobject-2.0.pc) are  
> > placed in /usr/lib/i386-linux-gnu/pkgconfig instead of  
> > /usr/lib/pkgconfig; thus I solved the problem by following these steps:
> 
> I’ve added /usr/lib/i386-linux-gnu/pkgconfig to the default  
> .pc search path in pkg-config.gem and released  
> it. (pkg-config gem 1.1.1 is the latest version.)
> 
> Please try again.

Works like a charm now.

> ## Thanks,
> 
> kou

Thank you very much,

-abc

---

<div class="post-metadata">

**Author:** ![ribbed21](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@ribbed21](https://www.ruby-forum.com/u/ribbed21)\
**Post date:** [May 2, 2011, 9:16pm UTC](https://www.ruby-forum.com/t/install-error-gtk2-on-ubuntu-natty-11-04/205535/9 "2011-05-02T21:16:49Z")

</div>

Vincent C. wrote in post #995328:

> 2011/4/8 Andrea D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > checking for new allocation framework… yes
> 
> I just tested to run “ruby extconf.rb” in glib2 directory on ubuntu  
> 11.04.  
> I have the same error. I Install libglib2.0-dev package to resolve it.  
> I can now build ruby-glib2 without errors.
> 
> libglib2.0-dev installs /usr/lib/pkgconfig/gobject-2.0.pc file that  
> why I ask to check for it in a previous mail.

Installing libglib2.0-dev didn’t work on my 11.04 Ubuntu machine. It  
turns out that on Natty some .pc files (including gobject-2.0.pc) are  
placed in /usr/lib/i386-linux-gnu/pkgconfig instead of  
/usr/lib/pkgconfig; thus I solved the problem by following these steps:

$ sudo apt-get install {libpango1.0,libglib2.0,libatk1.0,libcairo2,  
libgdk-pixbuf2.0,libgtk2.0}-dev

$ cd /usr/lib/pkgconfig/

$ sudo ln -s ../i386-linux-gnu/pkgconfig/{atk,fontconfig,  
freetype2,gio-2.0,gio-unix-2.0,glib-2.0,gmodule-no-export-2.0,  
gobject-2.0,gthread-2.0,libpng,pangocairo,pangoft2,pango,  
x11,xau,xcb,xcb-render,xcb-shm,xcomposite,xcursor,xdamage,xdmcp,  
xext,xfixes,xinerama,xi,xrandr,xrender}.pc .

$ sudo gem install gtk2

Hope it helps.

-abc
