Require 'wx' fails

I’ve recently reloaded my system. For some reason, I can’t get wxruby to
initialize. In irb, I see the following

require ‘rubygems’
require ‘wx’
LoadError: libwx_gtk2u_media-2.8.so.0: cannot open shared object file:
No such file or directory -
/usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so
from /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx.rb:12 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require’
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require’
from (irb):1

This seems to say that a file is missing. When I list the directory,
though, I see

[michael@photon ~]$ ls
/usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib -l
total 9732
drwxr-xr-x 3 root root 4096 2010-07-04 17:18 wx/
-rw-r–r-- 1 root root 1715 2010-07-04 17:18 wx.rb
-rwxr-xr-x 1 root root 9939967 2010-07-04 17:18 wxruby2.so*

Which seems clean. Can anyone offer any help here?
Thanks in advance
—Michael

Are you using ubuntu?
if so, perhaps you download wrong gem
because for new ubuntu, there is a special gem
or if you want to be sure, check previous post
about repo for wxruby

On 04/07/2010 23:29, Michael S. wrote:

I’ve recently reloaded my system. For some reason, I can’t get wxruby to
initialize. In irb, I see the following

require 'rubygems'
require 'wx'

LoadError: libwx_gtk2u_media-2.8.so.0: cannot open shared object file:
No such file or directory -

It looks like the wx library you are using hasn’t got support for
wxMediaCtrl included, whereas the wxRuby gem is expecting this class to
be supported.

It may be that this extra C++ library can be installed via your package
manager. Have a look for wx-2.8-xxx packages that are available but not
installed.

If not, the easiest way may to be compile your own wxRuby from source.
You’ll need SWIG and the wx-2.8-dev files. The compile process should
adapt and pick up the local configuration of wx.

alex

Alex F. wrote:

If not, the easiest way may to be compile your own wxRuby from source.
You’ll need SWIG and the wx-2.8-dev files. The compile process should
adapt and pick up the local configuration of wx.

It was a good idea, but it doesn’t work. The build of wxruby fails at
link with

 /usr/bin/ld: cannot find -lwx_gtk2u_media-2.8
 collect2: ld returned 1 exit status
 rake aborted!

I think I’m going to have to remove the version of wxwidgets supplied by
PCLinuxOS and do a source install. If anyone knows another way around
this, I’m certainly listening.

Thanks
—Michael

Alex F. wrote:

Before going that more drastic step, you could try force-ignoring
MediaCtrl

rake WXRUBY_EXCLUDED=MediaCtrl,MediaEvent

Alex, I owe you. That solved the problem and wxruby seems to be working.
At least
require ‘wx’

returns true.

THANK YOU VERY MUCH!
—Michael

Michael S. wrote:

It was a good idea, but it doesn’t work. The build of wxruby fails at
link with

 /usr/bin/ld: cannot find -lwx_gtk2u_media-2.8
 collect2: ld returned 1 exit status
 rake aborted!

I think I’m going to have to remove the version of wxwidgets supplied by
PCLinuxOS and do a source install. If anyone knows another way around
this, I’m certainly listening.

That should work, following the compile flags given on the wiki.

Before going that more drastic step, you could try force-ignoring
MediaCtrl

rake WXRUBY_EXCLUDED=MediaCtrl,MediaEvent

alex