Problem running Samples


#1

Hi. I’m desperately trying to learn Ruby and wxWidgets, on my 64-bit
Linux machine. However when I try to run any of the samples from the
command line I get the following error message:

ruby: symbol lookup error:
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86_64-linux/lib/wxruby2.so:
undefined symbol: Init_wxMediaCtrl

I’d be very grateful for any help. Many thanks in advance!


#2

Still having a problem with this. Anyone out there that can point me in
the right direction?


#3

Hi

Rooby N. wrote:

Still having a problem with this. Anyone out there that can point me in
the right direction?

I’m afraid I don’t have a AMD-64 machine I can test on.

We’re in the process of putting out a new wxRuby release which will
include an AMD-64 binary gem, and I hope this will resolve the issue.

Mario - please could you have a look at the original issue and verify
it’s resolved as you do the AMD-64 build? Thanks:

http://www.ruby-forum.com/topic/176654#new

alex


#4

Rooby N. wrote:

Many thanks for that quick response. Although I have an Intel Core2duo I
guess the AMD-64 build is essentially the same thing?

I believe so:
http://www.mail-archive.com/removed_email_address@domain.invalid/msg25169.html

a


#5

Alex

Many thanks for that quick response. Although I have an Intel Core2duo I
guess the AMD-64 build is essentially the same thing?


#6

If I may inquire, when you installed the 1.9.8 Build of wxRuby, did you
also install the associated wxWidgets packages needed from your Distro’s
repositories?
Also, if you did install from your Distro’s repositories, what version
of the wxWidgets libraries are installed?

Yes I did install the associated wxWidgets packages from my Distro’s
repositories (which is the latest Fedora 10). wxWidgets version 2.8.9
(GTK2 port of the wxWidgets GUI library) etc.

I’ve been trying to fix things at my end by uninstalling and
reinstalling etc and think I may have messed things up a little bit
beyond repair. I may just end up reinstalling Fedora and revert to the
32-bit version for an easy life…

Thanks for your help, R.


#7

Hello Rooby,

If I may inquire, when you installed the 1.9.8 Build of wxRuby, did you
also
install the associated wxWidgets packages needed from your Distro’s
repositories? I just want to make sure what kind of linking problem we
have
here, since it’s coming up with an Init_wxMediaCtrl undefined symbol
error.
Also, if you did install from your Distro’s repositories, what version
of
the wxWidgets libraries are installed?

Thanks,

Mario


#8

Rooby N. wrote:

Yes I did install the associated wxWidgets packages from my Distro’s
repositories (which is the latest Fedora 10). wxWidgets version 2.8.9
(GTK2 port of the wxWidgets GUI library) etc.

That sounds fine.

I’ve been trying to fix things at my end by uninstalling and
reinstalling etc and think I may have messed things up a little bit
beyond repair. I may just end up reinstalling Fedora and revert to the
32-bit version for an easy life…

I hope not! A rubygem for wxRuby 1.9.10 on AMD-64 is now available, you
might give that a try before giving up hope…

a


#9

Well, before you go and do that, I have just posted the 2.0 RC1 64bit
gem
for wxRuby, and if you would like, I can send you the gem, for you to
try,
and see if it will work or not. It should work, as I didn’t have any
problems. However, I’m running on Ubuntu, and I make my builds on
Ubuntu as
well.


#10

Alex F. wrote:

I hope not! A rubygem for wxRuby 1.9.10 on AMD-64 is now available, you
might give that a try before giving up hope…

I’m running wxruby 1.9.8. Is there an easy way to update to 1.9.10 -
I’ve tried gem update wxruby but there’s nothing to update apparently.

Thanks, Mark


#11

I’m having a similar problem:
(Which I think could be similar to
http://www.ruby-forum.com/topic/165803 although I would like to avoid
building from source if necessary)

Error message produced when trying to run some of the example files (eg
minimal.rb)

No debug:
$ ruby -rubygems minimal.rb
ruby: symbol lookup error:
/var/lib/gems/1.8/gems/wxruby-1.9.8-x86_64-linux/lib/wxruby2.so:
undefined symbol: Init_wxMediaCtrl

With debug enabled:
/var/lib/gems/1.8/gems/wxruby-1.9.8-x86_64-linux/samples/minimal$ ruby
-rubygems -debug minimal.rb
Exception LoadError' at /usr/lib/ruby/1.8/rubygems.rb:772 - no such file to load -- rubygems/defaults/operating_system ExceptionNameError’ at -e:1 - undefined local variable or method bug' for main:Object -e:1: undefined local variable or methodbug’ for main:Object
(NameError)

Any help will be greatly appreciated, thanks,

Mark

Debugging info:

$ lsb_release -a
LSB Version:
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:cxx-3.0-amd64:cxx-3.0-noarch:cxx-3.1-amd64:cxx-3.1-noarch:cxx-3.2-amd64:cxx-3.2-noarch:desktop-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.0-amd64:graphics-3.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch:graphics-3.2-amd64:graphics-3.2-noarch:languages-3.2-amd64:languages-3.2-noarch:multimedia-3.2-amd64:multimedia-3.2-noarch:printing-3.2-amd64:printing-3.2-noarch:qt4-3.1-amd64:qt4-3.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 8.10
Release: 8.10
Codename: intrepid

dpkg -l | egrep ‘wx|ruby|swig’
ii libart2-ruby1.8 0.17.0~rc1-6ubuntu1
Libart 2 bindings for the Ruby language
ii libatk1-ruby1.8 0.17.0~rc1-6ubuntu1
ATK bindings for the Ruby language
ii libcairo-ruby1.8 1.5.1-1+lenny1
Cairo bindings for the Ruby language
ii libdrb-ruby 4.2
transitional dummy package
ii liberb-ruby 4.2
transitional dummy package
ii libgdk-pixbuf2-ruby1.8 0.17.0~rc1-6ubuntu1
Gdk-Pixbuf 2 bindings for the Ruby language
ii libgemplugin-ruby1.8 0.2.3-1ubuntu1
Gem Based Plugin System
ii libglib2-ruby1.8 0.17.0~rc1-6ubuntu1
Glib 2 bindings for the Ruby language
ii libgnome2-ruby 0.17.0~rc1-6ubuntu1
GNOME 2 bindings for the Ruby language
ii libgnome2-ruby1.8 0.17.0~rc1-6ubuntu1
GNOME 2 bindings for the Ruby language
ii libgnomecanvas2-ruby1.8 0.17.0~rc1-6ubuntu1
GNOME Canvas 2 bindings for the Ruby languag
ii libgtk2-ruby1.8 0.17.0~rc1-6ubuntu1
GTK+ bindings for the Ruby language
ii libpango1-ruby1.8 0.17.0~rc1-6ubuntu1
Pango bindings for the Ruby language
ii libreadline-ruby1.8 1.8.7.72-1ubuntu0.1
Readline interface for Ruby 1.8
ii libruby 4.2
Libraries necessary to run Ruby 1.8.x
ii libruby1.8 1.8.7.72-1ubuntu0.1
Libraries necessary to run Ruby 1.8
ii libwxbase2.4-1 2.4.5.1.1ubuntu1
wxBase library (runtime) - non-GUI support c
ii libwxbase2.4-dev 2.4.5.1.1ubuntu1
wxBase library (development) - non-GUI suppo
ii libwxbase2.6-0 2.6.3.2.2-2ubuntu5
wxBase library (runtime) - non-GUI support c
ii libwxbase2.8-0 2.8.8.0-0ubuntu2
wxBase library (runtime) - non-GUI support c
ii libwxgtk2.4-1 2.4.5.1.1ubuntu1
wxWindows Cross-platform C++ GUI toolkit (GT
ii libwxgtk2.4-dev 2.4.5.1.1ubuntu1
wxWindows Cross-platform C++ GUI toolkit (GT
ii libwxgtk2.6-0 2.6.3.2.2-2ubuntu5
wxWidgets Cross-platform C++ GUI toolkit (GT
ii libwxgtk2.8-0 2.8.8.0-0ubuntu2
wxWidgets Cross-platform C++ GUI toolkit (GT
ii libyaml-ruby 4.2
transitional dummy package
ii libzlib-ruby 4.2
transitional dummy package
ii python-pythoncard 0.8.1-8.1ubuntu1
wxPython-based GUI construction framework (u
ii python-wxgtk2.4 2.4.5.1.1ubuntu1
wxWindows Cross-platform C++ GUI toolkit (wx
ii python-wxgtk2.6 2.6.3.2.2-2ubuntu5
wxWidgets Cross-platform C++ GUI toolkit (wx
ii python-wxgtk2.8 2.8.8.0-0ubuntu2
wxWidgets Cross-platform C++ GUI toolkit (wx
ii python-wxversion 2.8.8.0-0ubuntu2
wxWidgets Cross-platform C++ GUI toolkit (wx
ii rdoc 4.2
Generate documentation from ruby source file
ii ruby 4.2
An interpreter of object-oriented scripting
ii ruby-dev 4.2
Header files for compiling extension modules
ii ruby1.8 1.8.7.72-1ubuntu0.1
Interpreter of object-oriented scripting lan
ii ruby1.8-dev 1.8.7.72-1ubuntu0.1
Header files for compiling extension modules
ii rubygems
1.3.0~RC1really1.2.0-2ubuntu3 package management framework for
Ruby librar
ii rubygems1.8
1.3.0~RC1really1.2.0-2ubuntu3 package management framework for
Ruby librar
ii swig 1.3.35-4ubuntu1
Generate scripting interfaces to C/C++ code
ii wx2.4-examples 2.4.5.1.1ubuntu1
wxWindows Cross-platform C++ GUI toolkit (ex
ii wx2.4-headers 2.4.5.1.1ubuntu1
wxWindows Cross-platform C++ GUI toolkit (he
ii wx2.4-i18n 2.4.5.1.1ubuntu1
wxWindows Cross-platform C++ GUI toolkit (i1


#12

Mario,

Thanks for the suggestions.

Mario S. wrote:

The Problem with this, is you used -debug, which is only partly right.
What
you actually need, is ruby -d, cause you threw in there, an eval, which
is
done with the switch -e, but since -d doesn’t require any arguments, it
automatically processed the e as another command switch, which tried to
eval
‘bug’. Hence why there’s an NameError in that. :wink:

Here’s the correct output from ruby -d minimal.rb (I now only have the
2.8 packages on my machine)

$ ruby -d minimal.rb
Exception LoadError' at /usr/lib/ruby/1.8/rubygems.rb:772 - no such file to load -- rubygems/defaults/operating_system ExceptionLoadError’ at /usr/lib/ruby/1.8/rubygems/custom_require.rb:27

  • no such file to load – wx
    ruby: symbol lookup error:
    /var/lib/gems/1.8/gems/wxruby-1.9.8-x86_64-linux/lib/wxruby2.so:
    undefined symbol: Init_wxMediaCtrl

#13

On Thu, Feb 5, 2009 at 6:23 AM, Mark T. removed_email_address@domain.invalid
wrote:

ruby: symbol lookup error:
/var/lib/gems/1.8/gems/wxruby-1.9.8-x86_64-linux/lib/wxruby2.so:
undefined symbol: Init_wxMediaCtrl

The problem isn’t with wxRuby 1.9.8 in that area, it’s with the fact,
that
wxruby2.so, cannot find the Symbol Init_wxMediaCtrl, which is a C/C++
Side
problem.

With debug enabled:
/var/lib/gems/1.8/gems/wxruby-1.9.8-x86_64-linux/samples/minimal$ ruby
-rubygems -debug minimal.rb
Exception LoadError' at /usr/lib/ruby/1.8/rubygems.rb:772 - no such file to load -- rubygems/defaults/operating_system ExceptionNameError’ at -e:1 - undefined local variable or method bug' for main:Object -e:1: undefined local variable or methodbug’ for main:Object
(NameError)

The Problem with this, is you used -debug, which is only partly right.
What
you actually need, is ruby -d, cause you threw in there, an eval, which
is
done with the switch -e, but since -d doesn’t require any arguments, it
automatically processed the e as another command switch, which tried to
eval
‘bug’. Hence why there’s an NameError in that. :wink:

Any help will be greatly appreciated, thanks,

Mark

Debugging info:

It looks as though you have 2.8.8 installed for wxWidgets for the 2.8
series, as well as the 2.4, and the 2.6 series of wxWidgets. It may
mean
nothing, but I would try removing the 2.4 and 2.6 series libraries for
both
wxbase, and wxgtk, and then force a re-install of the 2.8 series, to see
if
that helps any.

Just a few suggestions.


#14

The RubyGems server is still updating the different mirrors that
RubyGems
runs through. You can find it here:
http://www.trilake.net/wxruby/wxruby-1.9.10-x86_64-linux.gem
To easily install it, just run the following commands in a console /
terminal:

wget http://www.trilake.net/wxruby/wxruby-1.9.10-x86_64-linux.gem
sudo gem install wxruby-1.9.10-x86_64-linux.gem


#15

What is your $PATH - do I need to add anything to it? It seems I have
Wx installed, but ruby can’t load it:

Sorry, I forgot to paste mine:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games


#16

Mario S. wrote:

The RubyGems server is still updating the different mirrors that
RubyGems
runs through. You can find it here:
http://www.trilake.net/wxruby/wxruby-1.9.10-x86_64-linux.gem
To easily install it, just run the following commands in a console /
terminal:

wget http://www.trilake.net/wxruby/wxruby-1.9.10-x86_64-linux.gem
sudo gem install wxruby-1.9.10-x86_64-linux.gem

No joy with 1.9.10 - and I removed 1.9.8 with sudo gem uninstall, just
to make sure there was no conflict.

What is your $PATH - do I need to add anything to it? It seems I have
Wx installed, but ruby can’t load it:

$ ruby -d helloworld_wx.rb
Exception LoadError' at helloworld_wx.rb:5 - no such file to load -- wx helloworld_wx.rb:5:inrequire’: no such file to load – wx (LoadError)
from helloworld_wx.rb:5

helloworld_wx.rb was taken from
http://wxruby.rubyforge.org/wiki/wiki.pl?Hello_World

Thanks, Mark


#17

Mark T. wrote:

What is your $PATH - do I need to add anything to it? It seems I have
Wx installed, but ruby can’t load it:

$ ruby -d helloworld_wx.rb

Exception LoadError' at helloworld_wx.rb:5 - no such file to load -- wx helloworld_wx.rb:5:inrequire’: no such file to load – wx (LoadError)
from helloworld_wx.rb:5

With ruby 1.8, you need to ensure you load rubygems before you can use
any library installed as a gem. Try:

ruby -rubygems helloworld_wx.rb

alex


#18

Try doing: ruby -rubygems -d helloworld_wx.rb


#19

Mario and Alex,

Thanks a lot. I’d already tried that multiple times, but looking back
on it, I think I’d tried it in conjunction with -dubug rather that -d

Anyway, it works fine now - thanks for your help.

Regards,

Mark


#20

Mario S. wrote:

Well, before you go and do that, I have just posted the 2.0 RC1 64bit
gem for wxRuby, and if you would like, I can send you the gem, for you to
try and see if it will work or not. It should work, as I didn’t have any
problems. However, I’m running on Ubuntu, and I make my builds on
Ubuntu as well.

Thanks for that.

OK - I have now re-installed my 64-bit Fedora from scratch. To the best
of my knowledge I’ve correctly installed Ruby, Rubygems, wxWidgets
2.8.9, and wxRuby 1.9.10.

I crossed my fingers and then… a different error message greeted me!
What joy:

ruby -rubygems minimal.rb
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86_64-linux/lib/wxruby2.so:
libwx_gtk2u_gl-2.8.so.0: cannot open shared object file: No such file or
directory -
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86_64-linux/lib/wxruby2.so
(LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' from /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86_64-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 minimal.rb:8

Arrrrgh! Any help would be appreciated. Thanks in advance.