# Wxruby2.so: \[BUG\] Segmentation fault on require 'wx'

**URL:** <https://www.ruby-forum.com/t/wxruby2-so-bug-segmentation-fault-on-require-wx/177836>\
**Category:** wxRuby\
**Created:** [October 25, 2009, 2:50am UTC](https://www.ruby-forum.com/t/wxruby2-so-bug-segmentation-fault-on-require-wx/177836 "2009-10-25T02:50:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gawk007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@gawk007](https://www.ruby-forum.com/u/gawk007)\
**Post date:** [October 25, 2009, 2:50am UTC](https://www.ruby-forum.com/t/wxruby2-so-bug-segmentation-fault-on-require-wx/177836/1 "2009-10-25T02:50:07Z")

</div>

Hi –

I am trying to get ruby 1.9 to run on my Windows Vista Ultimate computer  
with and Intel 32 bit processor and all OS updates applied.  
I installed ruby 1.9 on October 23, 2009 using the zip file  
(ruby-1.9.1-p129-i386-mswin32.zip) and the instructions located at:  
[OrangeCabin.com is for sale | HugeDomains](http://blog.orangecabin.com/2009/05/install-ruby-1-9-on-windows-using-zip-binary/).  
I was able to run several simple scripts. So far so good.  
I then went after wxruby and got it installed following the  
instructions at  
[http://wxruby.rubyforge.org/svn/trunk/wxruby/INSTALL](http://wxruby.rubyforge.org/svn/trunk/wxruby/INSTALL)

I tried to execute minimal.rb.  
Running it in any fashion from the command line e.g.  
ruby minimal.rb  
ruby -rubygems minimal.rb  
generated the error output you see below.  
I eliminated all the code and can produce the crash and the same output  
just by requiring ‘rubygems’ and ‘wx’. I called that file mini.rb and it  
is below. It will fail if the only two lines are:

require ‘rubygems’  
require ‘wx’

I searched around on the forums for a solution and have found none so I  
am posting and asking for help. In searching I’ve seen requests for the  
output of  
gem env and ruby -v so they are below too.

gem update system returns Nothing to update.

Thanks to anyone who can help and everyone who tries.

Doug

#### this is mini.rb

\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>

#!/usr/bin/env ruby

# wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team

# Freely reusable code: see SAMPLES-LICENSE.TXT for details

begin  
require ‘rubygems’  
rescue LoadError  
end  
require ‘wx’

\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>

C:\Program  
Files\Applications\Ruby\lib\ruby\gems\1.9.1\gems\wxruby-2.0.1-x86-mswin32-60\samples\minimal\>ruby  
-rubygems mini.rb  
C:/Program  
Files/Applications/Ruby/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mswin32-60/lib/wxruby2.so:  
[BUG] Segmentation fault  
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32]

## – control frame ---------- c:0008 p:-9088168 s:0021 b:0021 l:000020 d:000020 TOP c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :require c:0006 p:0011 s:0015 b:0015 l:000014 d:000014 TOP C:/Program Files/Applications/Ruby/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mswin32-60/lib/wx.rb:12 c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :require c:0003 p:0038 s:0006 b:0006 l:0001ac d:002364 EVAL mini.rb:9 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:0001ac d:0001ac TOP

– Ruby level backtrace  
information-----------------------------------------  
C:/Program  
Files/Applications/Ruby/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mswin32-60/lib/wx.rb:12:in  
`require' C:/Program Files/Applications/Ruby/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mswin32-60/lib/wx.rb:12:in `\<top (required)\>’  
mini.rb:9:in `require' mini.rb:9:in `’

[NOTE]  
You may encounter a bug of Ruby interpreter. Bug reports are welcome.  
For details: [http://www.ruby-lang.org/bugreport.html](http://www.ruby-lang.org/bugreport.html)

This application has requested the Runtime to terminate it in an unusual  
way.  
Please contact the application’s support team for more information.

\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>

C:\>ruby -v  
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32]

\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>

C:\>gem env  
RubyGems Environment:

- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.9.1 (2009-05-12 patchlevel 129) [i386-mswin32]
- INSTALLATION DIRECTORY: C:/Program  
Files/Applications/Ruby/lib/ruby/gems/1.9.1
- RUBYGEMS PREFIX: C:/Program  
Files/Applications/Ruby/lib/ruby/gems/1.9.1/gems/rubygems-update-1.3.5
- RUBY EXECUTABLE: “C:/Program Files/Applications/Ruby/bin/ruby.exe”
- EXECUTABLE DIRECTORY: C:/Program Files/Applications/Ruby/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-mswin32-60

- GEM PATHS:
  - C:/Program Files/Applications/Ruby/lib/ruby/gems/1.9.1
  - C:/Users/Doug/.gem/ruby/1.9.1

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [http://gems.rubyforge.org/](http://gems.rubyforge.org/)

\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>\<\>

---

<div class="post-metadata">

**Author:** ![gawk007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@gawk007](https://www.ruby-forum.com/u/gawk007)\
**Post date:** [October 25, 2009, 2:05pm UTC](https://www.ruby-forum.com/t/wxruby2-so-bug-segmentation-fault-on-require-wx/177836/2 "2009-10-25T14:05:12Z")

</div>

Alex F. wrote:

> hi doug
> 
> Doug Sands wrote:
> 
> > I am trying to get ruby 1.9 to run on my Windows Vista Ultimate computer  
> > with and Intel 32 bit processor and all OS updates applied.  
> > I installed ruby 1.9 on October 23, 2009 using the zip file  
> > (ruby-1.9.1-p129-i386-mswin32.zip)  
> > …
> 
> > C:/Program  
> > Files/Applications/Ruby/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mswin32-60/lib/wxruby2.so:  
> > [BUG] Segmentation fault  
> > ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32]
> 
> it looks like you may be using the wxruby gem built for Ruby version  
> 1.8 - these are not compatible with Ruby 1.9. We don’t currently have a  
> wxruby gem for Ruby 1.9 built with the microsoft compiler, but you can  
> use wxRuby and ruby 1.9 built with the mingw compiler. If you got to the  
> download page:
> 
> [http://rubyforge.org/frs/?group\_id=35](http://rubyforge.org/frs/?group_id=35)
> 
> you’ll see a mingw-…-setup.exe package. This is an all-in-one  
> development environment for Windows and Ruby 1.9, with wxruby already  
> installed. This should have you up and running quickly for GUI dev on MS  
> windows.
> 
> The one-click installer for ruby has moved to using MingW, so it’s our  
> best guess as wxRuby developers that this is future platform for ruby on  
> windows.
> 
> alex

Hello Alex –  
Worked like a charm. I feel kind of foolish for not having found the  
information suggesting I to do this is on my own given how much  
searching I did. Nevertheless, I didn’t, you helped, and I’m up and  
running.  
Thank you very much.  
Doug

---

<div class="post-metadata">

**Author:** ![gawk007](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@gawk007](https://www.ruby-forum.com/u/gawk007)\
**Post date:** [October 25, 2009, 1:29pm UTC](https://www.ruby-forum.com/t/wxruby2-so-bug-segmentation-fault-on-require-wx/177836/3 "2009-10-25T13:29:15Z")

</div>

hi doug

Doug Sands wrote:

> I am trying to get ruby 1.9 to run on my Windows Vista Ultimate computer  
> with and Intel 32 bit processor and all OS updates applied.  
> I installed ruby 1.9 on October 23, 2009 using the zip file  
> (ruby-1.9.1-p129-i386-mswin32.zip)  
> …

> C:/Program  
> Files/Applications/Ruby/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mswin32-60/lib/wxruby2.so:  
> [BUG] Segmentation fault  
> ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32]

it looks like you may be using the wxruby gem built for Ruby version  
1.8 - these are not compatible with Ruby 1.9. We don’t currently have a  
wxruby gem for Ruby 1.9 built with the microsoft compiler, but you can  
use wxRuby and ruby 1.9 built with the mingw compiler. If you got to the  
download page:

[http://rubyforge.org/frs/?group\_id=35](http://rubyforge.org/frs/?group_id=35)

you’ll see a mingw-…-setup.exe package. This is an all-in-one  
development environment for Windows and Ruby 1.9, with wxruby already  
installed. This should have you up and running quickly for GUI dev on MS  
windows.

The one-click installer for ruby has moved to using MingW, so it’s our  
best guess as wxRuby developers that this is future platform for ruby on  
windows.

alex
