# Problem running Samples

**URL:** <https://www.ruby-forum.com/t/problem-running-samples/158549>\
**Category:** wxRuby\
**Created:** [January 24, 2009, 6:14pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549 "2009-01-24T18:14:00Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 6, 2009, 7:35pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/21 "2009-02-06T19:35:04Z")

</div>

Mark T. wrote:

> Rooby N. wrote:
> 
> > Arrrrgh! Any help would be appreciated. Thanks in advance.
> 
> My problem was solved, I think, by carefully reviewing all the packages  
> to do with wx and ruby

I mean with my distribution package manager (for you, this would be yum)

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 6, 2009, 7:34pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/22 "2009-02-06T19:34:00Z")

</div>

Rooby N. wrote:

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

My problem was solved, I think, by carefully reviewing all the packages  
to do with wx and ruby that I had install and not installed. I  
installed the -dev packages that I thought may be remotely relevant. I  
also updated my wxruby gem to the latest amd64 release using the wget  
code suggested above, and removed the old gem.

My install now works even without the -rubygems option (as long as the  
code includes:

begin  
require ‘rubygems’  
rescue LoadError  
end

)

Hope that helps. Unfortunately, mine just started working after doing a  
number of things, so I’m not sure exactly what it was that fixed it. If  
I had to guess it would probably be the update of wxruby.

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 6, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/23 "2009-02-06T21:57:03Z")

</div>

> My problem was solved, I think, by carefully reviewing all the packages  
> to do with wx and ruby that I had install and not installed. I  
> installed the -dev packages that I thought may be remotely relevant.

Thanks for the suggestion, Mark. Using Fedora’s Package Manager I’ve  
installed wxGTK-devel-2.8.9-1 as suggested and hey presto - another  
error message:

$ ruby minimal.rb  
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wx/classes/app.rb:16:  
[BUG] Segmentation fault  
ruby 1.8.6 (2008-08-11) [x86\_64-linux]

$ ruby bigdemo.rb  
bigdemo.rb:823: [BUG] Segmentation fault  
ruby 1.8.6 (2008-08-11) [x86\_64-linux]

At least it’s less gobbledegook than last time so I guess I’m heading in  
the right direction?!!! Frankly I haven’t a clue what any of these error  
messages mean…

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 6, 2009, 10:27pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/24 "2009-02-06T22:27:58Z")

</div>

Rooby N. wrote:

> Just a thought, but the only two gems I have installed at the moment are  
> wx\_sugar (0.1.21) and wxruby (1.9.10) - should I have any others  
> installed which might help me out of this pickle?

try installing core and rake as well

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 6, 2009, 10:09pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/25 "2009-02-06T22:09:29Z")

</div>

Just a thought, but the only two gems I have installed at the moment are  
wx\_sugar (0.1.21) and wxruby (1.9.10) - should I have any others  
installed which might help me out of this pickle?

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 6, 2009, 11:36pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/26 "2009-02-06T23:36:23Z")

</div>

Mark T. wrote:

> Rooby N. wrote:
> 
> > Just a thought, but the only two gems I have installed at the moment are  
> > wx\_sugar (0.1.21) and wxruby (1.9.10) - should I have any others  
> > installed which might help me out of this pickle?
> 
> try installing core and rake as well

Thanks for the suggestion but after installing core and rake I’m still  
getting the same error message. I now have:

core (2.0.0)  
rake (0.8.3)  
wx\_sugar (0.1.21)  
wxruby (1.9.10)

The error message is pretty much the same for all samples:

$ ruby listbook.rb  
listbook.rb:174: [BUG] Segmentation fault  
ruby 1.8.6 (2008-08-11) [x86\_64-linux]

Which 64-bit Linux are you using?

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 7, 2009, 1:11am UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/27 "2009-02-07T01:11:21Z")

</div>

Rooby N. wrote:

> Thanks for the suggestion, Mark. Using Fedora’s Package Manager I’ve  
> installed wxGTK-devel-2.8.9-1 as suggested and hey presto - another  
> error message:
> 
> $ ruby minimal.rb  
> /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wx/classes/app.rb:16:  
> [BUG] Segmentation fault  
> ruby 1.8.6 (2008-08-11) [x86\_64-linux]

I’m afraid in this situation the only way to get more informative error  
messages is to use a debugger. Try something like

gdb ruby --args -rubygems minimal.rb

It should then start, enter ‘c’ to run the programme. Then when it  
crashes, at the gdb prompt, type ‘where’ and you should get a load of  
feedback. Post this back to the list.

Alternatively, it might be easier just to compile your own wxruby. If  
you have your own distro’s libwx-gtk and libwx-gtk-dev packages  
installed, download the .tar.gz file, unpack it, then do

rake gem WXRUBY\_VERSION=1.9.10  
sudo gem install wxruby

hth  
alex

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 7, 2009, 11:09am UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/28 "2009-02-07T11:09:01Z")

</div>

Hi Alex

Many thanks for your prompt and excellent guidance, however, I’m afraid  
I don’t seem to have made a great deal of progress yet.

> I’m afraid in this situation the only way to get more informative error  
> messages is to use a debugger. Try something like
> 
> gdb ruby --args -rubygems minimal.rb
> 
> It should then start, enter ‘c’ to run the programme. Then when it  
> crashes, at the gdb prompt, type ‘where’ and you should get a load of  
> feedback. Post this back to the list.

Here goes nothing…

$ gdb ruby --args -rubygems minimal.rb  
GNU gdb Fedora (6.8-29.fc10)  
Copyright (C) 2008 Free Software Foundation, Inc.  
License GPLv3+: GNU GPL version 3 or later  
[http://gnu.org/licenses/gpl.html](http://gnu.org/licenses/gpl.html)  
This is free software: you are free to change and redistribute it.  
There is NO WARRANTY, to the extent permitted by law. Type “show  
copying”  
and “show warranty” for details.  
This GDB was configured as “x86\_64-redhat-linux-gnu”…  
-rubygems: No such file or directory.  
(gdb) c  
The program is not being run.  
(gdb)

I then tried it a couple of different ways…

$ gdb ruby --args minimal.rb  
GNU gdb Fedora (6.8-29.fc10)  
Copyright (C) 2008 Free Software Foundation, Inc.  
License GPLv3+: GNU GPL version 3 or later  
[http://gnu.org/licenses/gpl.html](http://gnu.org/licenses/gpl.html)  
This is free software: you are free to change and redistribute it.  
There is NO WARRANTY, to the extent permitted by law. Type “show  
copying”  
and “show warranty” for details.  
This GDB was configured as “x86\_64-redhat-linux-gnu”…  
“/home/russell/wxsamples/minimal/minimal.rb”: not in executable format:  
File format not recognized  
(gdb) c  
The program is not being run.  
(gdb)

(sigh!) how about …

$ gdb ruby minimal.rb  
GNU gdb Fedora (6.8-29.fc10)  
Copyright (C) 2008 Free Software Foundation, Inc.  
License GPLv3+: GNU GPL version 3 or later  
[http://gnu.org/licenses/gpl.html](http://gnu.org/licenses/gpl.html)  
This is free software: you are free to change and redistribute it.  
There is NO WARRANTY, to the extent permitted by law. Type “show  
copying”  
and “show warranty” for details.  
This GDB was configured as “x86\_64-redhat-linux-gnu”…  
(no debugging symbols found)  
“/home/russell/wxsamples/minimal/minimal.rb” is not a core dump: File  
format not recognized  
Missing separate debuginfos, use: debuginfo-install  
ruby-1.8.6.287-2.fc10.x86\_64  
(gdb) c  
The program is not being run.  
(gdb)

> Alternatively, it might be easier just to compile your own wxruby. If  
> you have your own distro’s libwx-gtk and libwx-gtk-dev packages  
> installed, download the .tar.gz file, unpack it, then do
> 
> rake gem WXRUBY\_VERSION=1.9.10  
> sudo gem install wxruby

OK. I uninstalled the gem using  
$ sudo gem uninstall wxruby

I checked my distro’s package manager and the following are shown to be  
installed:  
wxGTK-2.8.9-1.fc10 (x86\_64)  
wxGTK-devel-2.8.9-1.fc10 (x86\_64)

I then downloaded and unpacked the relevant .tar.gz file, navigated to  
the wxruby-1.9.10 folder and took a deep breath.

$ rake gem --trace WXRUBY\_VERSION=1.9.10  
(in /home/russell/Download/wxruby-1.9.10)  
Enabling DYNAMIC build  
Enabling RELEASE build  
Enabling UNICODE build  
The following wxWidgets features are not available and will be skipped:  
PrinterDC  
\*\* Invoke gem (first\_time)  
\*\* Invoke default (first\_time)  
\*\* Invoke lib/wxruby2.so (first\_time)  
\*\* Invoke obj/AboutDialogInfo.o (first\_time)  
\*\* Invoke src/AboutDialogInfo.cpp (first\_time, not\_needed)  
\*\* Invoke swig/classes/AboutDialogInfo.i (first\_time, not\_needed)  
\*\* Invoke /home/russell/Download/wxruby-1.9.10/swig/common.i  
(first\_time, not\_needed)  
\*\* Invoke  
/home/russell/Download/wxruby-1.9.10/swig/classes/include/wxAboutDialogInfo.h  
(first\_time, not\_needed)  
\*\* Execute obj/AboutDialogInfo.o  
g++ -c -I/usr/lib64/wx/include/gtk2-unicode-release-2.8  
-I/usr/include/wx-2.8 -D\_FILE\_OFFSET\_BITS=64 -D\_LARGE\_FILES -D\_\_WXGTK\_\_  
-DwxABI\_VERSION=20808 -O2 -g -pipe -Wall -Wp,-D\_FORTIFY\_SOURCE=2  
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64  
-mtune=generic -Wall -fPIC -Wno-unused-function -I. -I  
/usr/lib64/ruby/1.8/x86\_64-linux -o obj/AboutDialogInfo.o  
src/AboutDialogInfo.cpp  
rake aborted!  
Command failed with status (127): [g++ -c  
-I/usr/lib64/wx/include/gtk2-unic…]  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:970:in `sh' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:983:in `call’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:983:in `sh' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1071:in `sh’  
./rake/rakewx.rb:152  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:614:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:614:in `execute’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:611:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:611:in `execute’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in  
`invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:570:in  
`invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:587:in `invoke\_prerequisites’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `invoke\_prerequisites’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:576:in  
`invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:570:in  
`invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:587:in `invoke\_prerequisites’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `invoke\_prerequisites’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:576:in  
`invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:570:in  
`invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:587:in `invoke\_prerequisites’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `invoke\_prerequisites’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:576:in  
`invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:570:in  
`invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:563:in `invoke’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2018:in `invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `top\_level’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `top\_level’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2035:in  
`standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1990:in `top\_level’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1969:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2035:in `standard\_exception\_handling’  
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1966:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31 /usr/bin/rake:19:in `load’  
/usr/bin/rake:19

Whaaaaaat!?!? As usual, any assistance would be gratefully appreciated.

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 7, 2009, 1:41pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/29 "2009-02-07T13:41:32Z")

</div>

Hello Rooby,

On Sat, Feb 7, 2009 at 4:09 AM, Rooby N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > It should then start, enter ‘c’ to run the programme. Then when it  
> > crashes, at the gdb prompt, type ‘where’ and you should get a load of  
> > feedback. Post this back to the list.
> 
> Here goes nothing…

Alright, Alex mis-typed the line to run the GDB Debugger, you actually need to do this: gdb --args ruby -rubygems minimal.rb

The problems, is that with the first two instances of the command you  
ran,  
GDB thinks your actually trying to execute the plain text file, thinking  
it’s a compiled program, which it isn’t, and hence why your getting the  
incorrect format.

The last instance, is another problem of mistaken identity, cause when  
you  
run the GDB with gdb ruby minimal.rb, it thinks minimal.rb is actually a  
core dump, which sometimes happens, and sometimes doesn’t. The core  
file,  
allows Programmers to use in conjunction with gdb, to trace through a  
program that crashed, without having to go through the trial and error  
to  
get to the point where the program crashed. Often useful for users to  
send  
to programmers. However, in this case, again, not something we want.  
Try  
the first command, if you want to re-install the gem (Which should now  
be  
publicly available through the normal sudo gem install wxruby.

> I checked my distro’s package manager and the following are shown to be  
> installed:  
> wxGTK-2.8.9-1.fc10 (x86\_64)  
> wxGTK-devel-2.8.9-1.fc10 (x86\_64)
> 
> I then downloaded and unpacked the relevant .tar.gz file, navigated to  
> the wxruby-1.9.10 folder and took a deep breath.

I believe this error comes from the fact that the GNU C++ Compiler is  
not  
installed. Also, it may be different on Fedora, but on Ubuntu, you also  
need to ensure that you have wxbase, and wxbase-dev installed alongside  
the  
wxgtk libraries. Each distro has their own way of distributing  
packages, as  
well as how to split packages up. 😉

I would go into Yum, or Fedora’s Package Manager, and install any  
Compilers  
you can find that is associated with C/C++, to ensure that there aren’t  
any  
problems.

Whaaaaaat!?!? As usual, any assistance would be gratefully appreciated.

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 7, 2009, 1:44pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/30 "2009-02-07T13:44:28Z")

</div>

Rooby N. wrote:

> Hi Alex
> 
> Many thanks for your prompt and excellent guidance, however, I’m afraid  
> I don’t seem to have made a great deal of progress yet.

> > It should then start, enter ‘c’ to run the programme. Then when it  
> > crashes, at the gdb prompt, type ‘where’ and you should get a load of  
> > feedback. Post this back to the list.
> 
> (gdb) c  
> The program is not being run.

My mistake, that should have been ‘r’ (for “run”) not ‘c’ (for  
“continue”). Try with that command

> g++ -c -I/usr/lib64/wx/include/gtk2-unicode-release-2.8  
> -I/usr/include/wx-2.8 -D\_FILE\_OFFSET\_BITS=64 -D\_LARGE\_FILES -D\_\_WXGTK\_\_  
> -DwxABI\_VERSION=20808 -O2 -g -pipe -Wall -Wp,-D\_FORTIFY\_SOURCE=2  
> -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64  
> -mtune=generic -Wall -fPIC -Wno-unused-function -I. -I  
> /usr/lib64/ruby/1.8/x86\_64-linux -o obj/AboutDialogInfo.o  
> src/AboutDialogInfo.cpp  
> rake aborted!  
> Command failed with status (127): [g++ -c  
> -I/usr/lib64/wx/include/gtk2-unic…]

We need to see the compiler error here. Rake seems to manage to provide  
every bit of information except the one useful one…

Try copying and pasting the line that begins “g++ -c -I/usr/lib64…”  
and ends “…src/AboutDialogInfo.cpp” onto the command line and see what  
error g++ is returning.

thanks for your patience  
alex

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 7, 2009, 3:49pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/31 "2009-02-07T15:49:08Z")

</div>

> Alright, Alex mis-typed the line to run the GDB Debugger, you actually  
> need to do this:  
> gdb --args ruby -rubygems minimal.rb

Hold on tight…

$ gdb --args ruby -rubygems minimal.rb  
GNU gdb Fedora (6.8-29.fc10)  
Copyright (C) 2008 Free Software Foundation, Inc.  
License GPLv3+: GNU GPL version 3 or later  
[http://gnu.org/licenses/gpl.html](http://gnu.org/licenses/gpl.html)  
This is free software: you are free to change and redistribute it.  
There is NO WARRANTY, to the extent permitted by law. Type “show  
copying”  
and “show warranty” for details.  
This GDB was configured as “x86\_64-redhat-linux-gnu”…  
(no debugging symbols found)  
Missing separate debuginfos, use: debuginfo-install  
ruby-1.8.6.287-2.fc10.x86\_64  
(gdb) r  
Starting program: /usr/bin/ruby -rubygems minimal.rb  
(no debugging symbols found)  
[Thread debugging using libthread\_db enabled]  
(no debugging symbols found)  
[New Thread 0x7ffff7fe26f0 (LWP 31973)]  
(no debugging symbols found)  
Program received signal SIGSEGV, Segmentation fault.  
0x000000315ba92530 in wxFontMapperBase::Get () from  
/usr/lib64/libwx\_baseu-2.8.so.0  
(gdb) c  
Continuing.  
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wx/classes/app.rb:16:  
[BUG] Segmentation fault  
ruby 1.8.6 (2008-08-11) [x86\_64-linux]

Program received signal SIGABRT, Aborted.  
0x0000003151c32f05 in raise () from /lib64/libc.so.6

> ensure that you have wxbase, and wxbase-dev installed alongside  
> the wxgtk libraries.

I only have wxBase-2.8.9-1.fc10 (x86\_64), there’s no corresponding ‘dev’  
in the Package Manager and I had a quick Google around for one but  
didn’t find anything.

> I believe this error comes from the fact that the GNU C++ Compiler is  
> not installed.  
> I would go into Yum, or Fedora’s Package Manager, and install any  
> Compilers you can find that is associated with C/C++, to ensure that there  
> aren’t any problems.

I installed GCC (and the C++ Support for GCC package) and entered:  
rake gem WXRUBY\_VERSION=1.9.10  
which seemed to work - it produced many many lines of text while  
compiling with a few warnings along the way but finished up with:

:0:Warning: Gem::manage\_gems is deprecated and will be removed on or  
after March 2009.  
WARNING: RDoc will not be generated (has\_rdoc == false)  
Successfully built RubyGem  
Name: wxruby  
Version: 1.9.10  
File: wxruby-1.9.10-x86\_64-linux.gem

I then entered:

$ sudo gem install wxruby  
Successfully installed wxruby-1.9.10-x86\_64-linux  
1 gem installed

Crunch time… fingers crossed…

$ ruby minimal.rb  
ruby: symbol lookup error:  
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wxruby2.so:  
undefined symbol: Init\_wxAboutDialogInfo

Doh!!

> Try copying and pasting the line that begins “g++ -c -I/usr/lib64…”  
> and ends “…src/AboutDialogInfo.cpp” onto the command line and see what  
> error g++ is returning.

Alex - I did that and it produced nothing at all to report - I guess the  
GCC compiler took care of that issue. Is it a coincidence though that  
the AboutDialogInfo is also mentioned in the above error message  
perhaps?

> thanks for your patience

No, thank YOU (Alex, Mario, Mark) for your help thus far.

I just hope we’re getting closer to a solution.

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 7, 2009, 6:50pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/32 "2009-02-07T18:50:03Z")

</div>

Rooby N. wrote:

> (no debugging symbols found)  
> Program received signal SIGSEGV, Segmentation fault.  
> 0x000000315ba92530 in wxFontMapperBase::Get () from  
> /usr/lib64/libwx\_baseu-2.8.so.0  
> (gdb) c  
> Continuing.  
> /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wx/classes/app.rb:16:  
> [BUG] Segmentation fault  
> ruby 1.8.6 (2008-08-11) [x86\_64-linux]

This is where you now type ‘where’ at the (gdb) prompt to get a  
backtrace of the fault. However since it says there are “no debugging  
symbols found” it may not actually help us.

> :0:Warning: Gem::manage\_gems is deprecated and will be removed on or  
> after March 2009.  
> WARNING: RDoc will not be generated (has\_rdoc == false)  
> Successfully built RubyGem  
> Name: wxruby  
> Version: 1.9.10  
> File: wxruby-1.9.10-x86\_64-linux.gem

This looks good.

> /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wxruby2.so:  
> undefined symbol: Init\_wxAboutDialogInfo

Not so good. Since you earlier had problems on this file before you  
installed gcc, you could try doing ‘rake clean’ before building the gem  
again.

If this still isn’t helping, try deleting lib/wxruby2.so, then running  
“rake -v”, and post the long line at the end of the output, which will  
start something like

g++ -shared -fPIC -o [then a long list of Wx class names, like  
obj/AboutDialogInfo.o] and ending in lib/wxruby2.so

a

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 8, 2009, 1:45am UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/33 "2009-02-08T01:45:10Z")

</div>

On Sat, Feb 7, 2009 at 11:46 AM, Alex F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ruby 1.8.6 (2008-08-11) [x86\_64-linux]  
> > Name: wxruby  
> > Successfully installed wxruby-1.9.10-x86\_64-linux

Actually, this isn’t working, cause your still installing the gem from  
the  
RubyGems repository, but I would also suggest you do as Alex says, and  
run  
rake clean, and rake clean\_src, then run the previous rake command to  
build  
the gem, and to ensure that your installing the local built gem, do sudo  
gem  
install wxruby-1.9.10-x86\_64-linux.gem

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 7, 2009, 6:28pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/34 "2009-02-07T18:28:03Z")

</div>

Further to my previous message, I’ve just tried to run it with the debug  
option. Perhaps this might offer any clues.

$ ruby -d minimal.rb  
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.8/rubygems.rb:871 - no such file to load -- rubygems/defaults/operating_system Exception`LoadError’ at  
/usr/lib/ruby/site\_ruby/1.8/rubygems/config\_file.rb:35 - no such file to  
load – Win32API  
Exception `LoadError’ at  
/usr/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31 - no such file  
to load – wx  
ruby: symbol lookup error:  
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wxruby2.so:  
undefined symbol: Init\_wxAboutDialogInfo

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 8, 2009, 1:43pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/35 "2009-02-08T13:43:06Z")

</div>

> This is where you now type ‘where’ at the (gdb) prompt to get a  
> backtrace of the fault. However since it says there are “no debugging  
> symbols found” it may not actually help us.

I’ll try that again, although I don’t know how relevant this test is  
after all the to-ing and fro-ing, but for what it’s worth…

$ gdb --args ruby -rubygems minimal.rb  
GNU gdb Fedora (6.8-29.fc10)  
Copyright (C) 2008 Free Software Foundation, Inc.  
License GPLv3+: GNU GPL version 3 or later  
[http://gnu.org/licenses/gpl.html](http://gnu.org/licenses/gpl.html)  
This is free software: you are free to change and redistribute it.  
There is NO WARRANTY, to the extent permitted by law. Type “show  
copying”  
and “show warranty” for details.  
This GDB was configured as “x86\_64-redhat-linux-gnu”…  
(gdb) r  
Starting program: /usr/bin/ruby -rubygems minimal.rb  
[Thread debugging using libthread\_db enabled]  
[New Thread 0x7ffff7fe26f0 (LWP 3132)]

Program received signal SIGSEGV, Segmentation fault.  
0x000000315ba92530 in wxFontMapperBase::Get () from  
/usr/lib64/libwx\_baseu-2.8.so.0  
Missing separate debuginfos, use: debuginfo-install  
GConf2-2.24.0-1.fc10.x86\_64 ORBit2-2.14.16-1.fc10.x86\_64  
SDL-1.2.13-6.fc10.x86\_64 atk-1.24.0-1.fc10.x86\_64  
bug-buddy-2.24.2-1.fc10.x86\_64 cairo-1.8.0-1.fc10.x86\_64  
dbus-glib-0.76-3.fc10.x86\_64 dbus-libs-1.2.4-2.fc10.x86\_64  
e2fsprogs-libs-1.41.3-2.fc10.x86\_64 elfutils-libelf-0.137-3.fc10.x86\_64  
expat-2.0.1-5.x86\_64 fontconfig-2.6.0-3.fc10.x86\_64  
freetype-2.3.7-2.fc10.x86\_64 glib2-2.18.4-1.fc10.x86\_64  
gstreamer-0.10.21-2.fc10.x86\_64  
gstreamer-plugins-base-0.10.21-2.fc10.x86\_64  
gtk-nodoka-engine-0.7.2-1.fc10.x86\_64 gtk2-2.14.7-1.fc10.x86\_64  
libICE-1.0.4-4.fc10.x86\_64 libSM-1.1.0-2.fc10.x86\_64  
libX11-1.1.4-6.fc10.x86\_64 libXau-1.0.4-1.fc10.x86\_64  
libXcomposite-0.4.0-5.fc10.x86\_64 libXcursor-1.1.9-3.fc10.x86\_64  
libXdamage-1.1.1-4.fc9.x86\_64 libXdmcp-1.0.2-6.fc10.x86\_64  
libXext-1.0.4-1.fc9.x86\_64 libXfixes-4.0.3-4.fc10.x86\_64  
libXft-2.1.13-1.fc10.x86\_64 libXi-1.1.3-4.fc9.x86\_64  
libXinerama-1.0.3-2.fc10.x86\_64 libXrandr-1.2.3-1.fc10.x86\_64  
libXrender-0.9.4-3.fc9.x86\_64 libcanberra-0.10-3.fc10.x86\_64  
libcanberra-gtk2-0.10-3.fc10.x86\_64 libcap-2.10-2.fc10.x86\_64  
libgcc-4.3.2-7.x86\_64 libjpeg-6b-43.fc10.x86\_64  
libogg-1.1.3-9.fc9.x86\_64 libpng-1.2.34-1.fc10.x86\_64  
libselinux-2.0.73-1.fc10.x86\_64 libstdc+±4.3.2-7.x86\_64  
libtdb-1.1.1-26.fc10.x86\_64 libtiff-3.8.2-11.fc10.x86\_64  
libtool-ltdl-1.5.26-4.fc10.x86\_64 libvorbis-1.2.0-5.fc10.x86\_64  
libxcb-1.1.91-5.fc10.x86\_64 libxml2-2.7.3-1.fc10.x86\_64  
mesa-libGLU-7.2-0.15.fc10.x86\_64 pango-1.22.3-1.fc10.x86\_64  
pixman-0.12.0-2.fc10.x86\_64 wxBase-2.8.9-1.fc10.x86\_64  
wxGTK-2.8.9-1.fc10.x86\_64 wxGTK-gl-2.8.9-1.fc10.x86\_64  
zlib-1.2.3-18.fc9.x86\_64  
(gdb) where  
#0 0x000000315ba92530 in wxFontMapperBase::Get () from  
/usr/lib64/libwx\_baseu-2.8.so.0  
#1 0x000000315ba933f9 in wxFontMapperModule::OnInit () from  
/usr/lib64/libwx\_baseu-2.8.so.0  
#2 0x000000315baabcde in wxModule::DoInitializeModule () from  
/usr/lib64/libwx\_baseu-2.8.so.0  
#3 0x000000315baabebc in wxModule::InitializeModules () from  
/usr/lib64/libwx\_baseu-2.8.so.0  
#4 0x000000315ba99a1a in wxEntryStart () from  
/usr/lib64/libwx\_baseu-2.8.so.0  
#5 0x000000315ba99b4b in wxEntry () from  
/usr/lib64/libwx\_baseu-2.8.so.0  
#6 0x00007ffff6b9d5d6 in wxRubyApp::main\_loop () from  
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wxruby2.so  
#7 0x00007ffff6b9aa17 in ?? () from  
/usr/lib/ruby/gems/1.8/gems/wxruby-1.9.10-x86\_64-linux/lib/wxruby2.so  
#8 0x0000003152c3a3e0 in rb\_call0 (klass=140737348220440,  
recv=140737296067360, id=25337, oid=25337, argc=0, argv=0x0,  
body=0x7ffff7a58738, flags=) at eval.c:5870  
#9 0x0000003152c3a59a in rb\_call (klass=140737348220440,  
recv=140737296067360, mid=25337, argc=0, argv=0x0, scope=0,  
self=140737348220440) at eval.c:6117  
#10 0x0000003152c345f0 in rb\_eval (self=140737348220440, n=) at eval.c:3490  
#11 0x0000003152c3a2e3 in rb\_call0 (klass=140737348220360,  
recv=140737348220440, id=5129, oid=5129, argc=0, argv=0x0,  
body=0x7ffff490ed58, flags=) at eval.c:6021  
#12 0x0000003152c3a59a in rb\_call (klass=140737348220360,  
recv=140737348220440, mid=5129, argc=0, argv=0x0, scope=0,  
self=140737354003280) at eval.c:6117  
#13 0x0000003152c345f0 in rb\_eval (self=140737354003280, n=) at eval.c:3490  
#14 0x0000003152c37d70 in rb\_eval (self=140737354003280, n=) at eval.c:3220  
#15 0x0000003152c472db in ruby\_exec\_internal () at eval.c:1642  
#16 0x0000003152c47325 in ruby\_exec () at eval.c:1662  
#17 0x0000003152c47352 in ruby\_run () at eval.c:1672  
#18 0x0000000000400833 in main (argc=3, argv=0x7fffffffe368, envp=) at main.c:48  
(gdb)

> (Alex) Not so good. Since you earlier had problems on this file before you  
> installed gcc, you could try doing ‘rake clean’ before building the gem  
> again.

> (Mario) run rake clean, and rake clean\_src, then run the previous rake  
> command to build the gem, and to ensure that your installing the local  
> built gem, do sudo gem install wxruby-1.9.10-x86\_64-linux.gem

I followed this invaluable advice…

$ ruby minimal.rb

Guess what - IT WORKED!!! Many thanks for your help throughout all  
this. I was starting to feel very much out of my depth and confess to  
being close to trying a different 64-bit distro or even reverting to a  
32-bit one to get it to work. Great support, you guys, well done.

I hope that, in some way, my experiences may have contributed something  
to your own efforts in development. With any luck I’m now on my way to  
experimenting and developing in this exciting environment. I hope you  
don’t mind if I fire the odd question at you in this forum.

I would be interested to know why compiling my own wxruby gem worked  
successfully (eventually, with your help) and the downloadable one  
didn’t?

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 8, 2009, 7:38pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/36 "2009-02-08T19:38:04Z")

</div>

Hello Rooby,

$ ruby minimal.rb

> > Guess what - IT WORKED!!!
> 
> That’s great news; I hope you enjoy working with wxRuby.

Yes, that is great news that you got it to work.

> being sure that the configuration where we build the gems is going to be  
> gems.
> 
> Not a specific explanation, but hopefully some background

To expand about this a bit more, Linux distros have different sets of  
libraries, installed in a different way, per Linux distro. Ubuntu is  
the  
most common Linux distro out there, but with the problems that are on  
Linux,  
it’s kinda hard to tailor to every single possible combination. Some  
people  
don’t have OpenGL Libraries installed, and if we compile the Linux Gem  
with  
OpenGL Infrastructure being present, then every place that it is  
installed  
to, needs the OpenGL Libraries.

There’s even standard libraries, like the C Standard Library, that  
differs  
in versions between platforms, and code compiled with newer versions of  
C  
Standard Library, won’t work with an older version. It is our hope, and  
plan, that once we have a full 2.0 stable release, that we are going to  
see  
about getting some standard linux distro packages out there for the  
major  
linux distros, such as Fedora, Debian/Ubuntu, Mandrivia, etc, etc. But  
we  
need people who are experienced in making packages to help us get this  
setup, so we’ll hopefully be able to get soemthing done, to where you  
won’t  
have to use gem to install, but your own Package Manager.

Often times, then not, it’s just more simple to compile the package  
yourself, then to use the gem repositories, when using an Distro other  
then  
Ubuntu. Unfortunate as that may be. Just the way it is.

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 9, 2009, 7:15pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/37 "2009-02-09T19:15:54Z")

</div>

Alex and Mario, many many thanks for taking the time to explain the  
issues regarding compiling, Linux distro’s etc, and also for getting me  
up and running.

---

<div class="post-metadata">

**Author:** ![rustee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@rustee](https://www.ruby-forum.com/u/rustee)\
**Post date:** [February 8, 2009, 6:10pm UTC](https://www.ruby-forum.com/t/problem-running-samples/158549/38 "2009-02-08T18:10:23Z")

</div>

Rooby N. wrote:

> > This is where you now type ‘where’ at the (gdb) prompt to get a  
> > backtrace of the fault. However since it says there are “no debugging  
> > symbols found” it may not actually help us.
> 
> I’ll try that again, although I don’t know how relevant this test is  
> after all the to-ing and fro-ing, but for what it’s worth…

…

> GConf2-2.24.0-1.fc10.x86\_64 ORBit2-2.14.16-1.fc10.x86\_64  
> SDL-1.2.13-6.fc10.x86\_64 atk-1.24.0-1.fc10.x86\_64  
> bug-buddy-2.24.2-1.fc10.x86\_64 cairo-1.8.0-1.fc10.x86\_64  
> dbus-glib-0.76-3.fc10.x86\_64 dbus-libs-1.2.4-2.fc10.x86\_64  
> e2fsprogs-libs-1.41.3-2.fc10.x86\_64 elfutils-libelf-0.137-3.fc10.x86\_64  
> expat-2.0.1-5.x86\_64 fontconfig-2.6.0-3.fc10.x86\_64  
> freetype-2.3.7-2.fc10.x86\_64 glib2-2.18.4-1.fc10.x86\_64  
> gstreamer-0.10.21-2.fc10.x86\_64

etc etc … this list of libraries gives you an idea of the number of  
dependencies for wxRuby

> $ ruby minimal.rb
> 
> Guess what - IT WORKED!!!

That’s great news; I hope you enjoy working with wxRuby.

> I would be interested to know why compiling my own wxruby gem worked  
> successfully (eventually, with your help) and the downloadable one  
> didn’t?

So would we. The basic problem is that Linux systems (esp for desktops)  
are made up of lots of different components, each produced by unrelated  
projects. Then different distros - separate teams again - assemble these  
in various combinations and versions.

wxWidgets alone has dozens of configuration options. There’s no way of  
being sure that the configuration where we build the gems is going to be  
compatible with where they get installed, so we just plump for the most  
common (Ubuntu) and hope for the best. When you compile your own wxRuby,  
it reads and adapts to the configuration of wxWidgets etc on your  
system.

On OS X and Windows, the native GUI features that wxRuby hooks into are  
supplied by a single vendor in a much more controlled way, with a very  
limited range of versions (we basically support 2 on each: XP, Vista,  
10.4, 10.5). On the other hand, setting up and using Windows compiler  
infrastructure with open source products is much less convenient than on  
Linux, so it makes sense for almost all Windows users to use the binary  
gems.

Not a specific explanation, but hopefully some background

a

[Previous page](https://www.ruby-forum.com/t/problem-running-samples/158549.md?page=1)
