# Require 'gtk2' fails

**URL:** <https://www.ruby-forum.com/t/require-gtk2-fails/222861>\
**Category:** Ruby-Gnome 2\
**Created:** [September 13, 2012, 2:08am UTC](https://www.ruby-forum.com/t/require-gtk2-fails/222861 "2012-09-13T02:08:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [September 13, 2012, 2:08am UTC](https://www.ruby-forum.com/t/require-gtk2-fails/222861/1 "2012-09-13T02:08:08Z")

</div>

require ‘gtk2’ results in :

/home/dml/.rvm/gems/ruby-1.9.2-p180/gems/gtk2-1.1.5/lib/gtk2.rb: line 13  
Gtk-MESSAGE \*\*:Failed to load module “canberra-gtk-module”:  
libcanberra-gtk-module.so: cannot open shared object file: No such file  
or directory

I have 2 laptops with the same application. I have only used 1 for some  
time.  
I updated the second with latest application and also updated it to  
opensuse 12.2 .

Both laptops are running opensuse 12.2 and gtk2 gem 1.1.5 .

The environment has:

GTK2\_RC\_FILES=/etc/gtk-2.0/gtkrc:/home/dml/.gtkrc-2.0-kde4:/home/dml/.gtkrc-2.0-qtengine:/home/dml/.gtkrc-2.0:/home/dml/.kde4/share/config/gtkrc-2.0  
GTK\_RC\_FILES=/etc/gtk/gtkrc:/home/dml/.gtkrc:/home/dml/.kde4/share/config/gtkrc  
GTK\_MODULES=canberra-gtk-module  
GTK\_IM\_MODULE=cedilla

ls -l /usr/lib/gtk-2.0/modules/

-rwxr-xr-x 1 root root 22252 Jul 15 23:12 libcanberra-gtk-module.so  
-rwxr-xr-x 1 root root 332056 Jul 15 19:08 libgail.so

and ls -l /usr/lib64/gtk-2.0/modules/

-rwxr-xr-x 1 root root 23256 Jul 16 19:18 libcanberra-gtk-module.so  
-rwxr-xr-x 1 root root 57104 Jul 16 12:22 libferret.so  
-rwxr-xr-x 1 root root 327544 Jul 16 12:22 libgail.so

So why does one system work and the other not. How do I tell where ruby  
is searching for the shared object file?

---

<div class="post-metadata">

**Author:** ![bluntsword](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f1d935/32.png) [@bluntsword](https://www.ruby-forum.com/u/bluntsword)\
**Post date:** [September 13, 2012, 5:05am UTC](https://www.ruby-forum.com/t/require-gtk2-fails/222861/2 "2012-09-13T05:05:11Z")

</div>

I can get past the gtk problem by adding /usr/lib64/gtk-2.0/modules/ to  
$LD\_LIBRARY\_PATH which was previously undefined. Note that is also  
undefined on the working system.

Now I get a segmentation on openssl.

I noticed that the working system has 1.9.2-290 and the broken has  
1.9.2=p180 . I have updated the p180 system bu now need to add the  
required gems.

---

<div class="post-metadata">

**Author:** ![bluntsword](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f1d935/32.png) [@bluntsword](https://www.ruby-forum.com/u/bluntsword)\
**Post date:** [September 13, 2012, 11:47pm UTC](https://www.ruby-forum.com/t/require-gtk2-fails/222861/3 "2012-09-13T23:47:37Z")

</div>

After installing 1.9.2-p290 I loaded the gems gtk2 & mysql. The program  
now runs. So why does this system need LD\_LIBRARY\_PATH and why did I  
need p290?
