# Cannot get my wx script to run

**URL:** <https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717>\
**Category:** wxRuby\
**Created:** [November 6, 2010, 1:01am UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717 "2010-11-06T01:01:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 6, 2010, 1:01am UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/1 "2010-11-06T01:01:57Z")

</div>

I can’t get my script to run. It just gives me the error:

/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)  
/home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb  
/usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require': no such file to load -- Wx (LoadError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in`require’  
from  
/home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb:4  
from -e:1:in `load’  
from -e:1

Process finished with exit code 1

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 6, 2010, 1:14am UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/2 "2010-11-06T01:14:29Z")

</div>

I got errors like this (“no such file to load”) running 1.9 Ruby and  
installing the wrong wx. If you’re running 1.9, try this one:

[http://rubygems.org/gems/wxruby-ruby19](http://rubygems.org/gems/wxruby-ruby19)

This whole 1.8/1.9 thing is a huge pain. Going into the interactive  
ruby and just typing require ‘wx’ may be a quicker way to work on this  
issue.

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 6, 2010, 10:42pm UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/3 "2010-11-06T22:42:06Z")

</div>

Michael Gardiner wrote in post #959702:

> I can’t get my script to run. It just gives me the error:
> 
> /usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)  
> /home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb  
> /usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in  
> `gem_original_require': no such file to load -- Wx (LoadError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require’  
> from  
> /home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb:4  
> from -e:1:in `load’  
> from -e:1

The best you can do is to download the gem from rubyforge and install it  
with the gem command  
(gem install PATH\_TO\_THE\_DOWNLOADED\_GEM).

For some reason installing wxruby via gems doesn’t work very well (it’s  
actually very unstable: it either can’t find any gems, or installs  
version 1.9 of wxRuby).

I see you’re using ruby 1.8, so you’ll have to grab the package from  
[http://rubyforge.org/frs/?group\_id=35](http://rubyforge.org/frs/?group_id=35)

hope that helps

Łukasz

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 4:22am UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/4 "2010-11-07T04:22:50Z")

</div>

So i tried to put that second error message into my path and it seemed  
to work, kin of. Now I get this message when I try to run my scrip in  
RubyMine:

/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)  
/home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb  
/usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require': no such file to load -- Wx (LoadError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in`require’  
from  
/home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb:4  
from -e:1:in `load’  
from -e:1

Process finished with exit code 1

And this messag3e when I try to debug my script in rubymine:

/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)  
/var/lib/gems/1.8/bin/rdebug-ide --port 37753 –  
/home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb

Process finished with exit code 0

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 4:29am UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/5 "2010-11-07T04:29:11Z")

</div>

I think there’s a problem in this script, see attached.

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 3:38am UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/6 "2010-11-07T03:38:40Z")

</div>

It installed the gem. I am using ruby 1.8 and when i installed it it  
said:

Warning: Installing to ~/.gem since /var/lib/gems/1.8 and  
/var/lib/gems/1.8/bin/crystalmoth/.gem/ruby/1.8/bin in your path.  
Warning: You don;t have /home/crystalmoth/.gem/ruby/1.8/bin in your  
path, gem executables will not run.

Now I just get this message:

/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)  
/var/lib/gems/1.8/bin/rdebug-ide --port 59342 –  
/home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb  
Fast Debugger (ruby-debug-ide 0.4.7) listens on :59342  
/usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in`require’  
/home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb:4  
/var/lib/gems/1.8/gems/ruby-debug-ide-0.4.7/lib/ruby-debug.rb:109:in  
`debug_load' /var/lib/gems/1.8/gems/ruby-debug-ide-0.4.7/lib/ruby-debug.rb:109:in`debug\_program’  
/var/lib/gems/1.8/gems/ruby-debug-ide-0.4.7/bin/rdebug-ide:87  
/var/lib/gems/1.8/bin/rdebug-ide:19:in `load' /var/lib/gems/1.8/bin/rdebug-ide:19 -e:1:in`load’  
-e:1  
Uncaught exception: no such file to load – Wx

Process finished with exit code 0

Do I just have to set my PATH? If so, how?

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 4:36am UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/7 "2010-11-07T04:36:41Z")

</div>

or see this attached

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 5:10am UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/8 "2010-11-07T05:10:50Z")

</div>

Or see this attached.

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 12:12pm UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/9 "2010-11-07T12:12:44Z")

</div>

Michael Gardiner wrote in post #959862:

> So i tried to put that second error message into my path and it seemed  
> to work, kin of. Now I get this message when I try to run my scrip in  
> RubyMine:
> 
> /usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)  
> /home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb  
> /usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in  
> `gem_original_require': no such file to load -- Wx (LoadError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require’  
> from  
> /home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb:4  
> from -e:1:in `load’  
> from -e:1

Looks like RubyMine doesn’t use your PATH variable.  
Can you try something like this:

- after installing the gem, and adding .gem to your path  
(  
do:  
export PATH=/home/crystalmoth/.gem/ruby/gems/1.8/gems:$PATH  
export PATH=/home/crystalmoth/.gem/ruby/1.8/bin:$PATH  
in the terminal or add these lines to your .profile/.bashrc  
)

Can you try running the MainFrame.rb directly from the command line  
(that’d be `ruby MainFrame.rb`)

If that works that means you simply need to add the path to your local  
gems to RubyMine settings.

Also - what OS are you using? (I’m assuming it’s either Linux or OSX)

Łukasz

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 5:01pm UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/10 "2010-11-07T17:01:48Z")

</div>

Michael Gardiner wrote in post #959939:

> I tried those lines of path code. It didn’t give me any errors, but then  
> I tried running it from the terminal and got this message:
> 
> /usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in  
> 'gem\_original\_require: no such file to load --Wx (LoadError)  
> from /usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in

…and here’s your problem

In the attached example you have

require ‘Wx’

and it should be

require ‘wx’ # lowercase

Once you change it wxRuby will be imported properly, the code won’t run  
though (I assume it’s a part of a bigger application) - try one of the  
minimal examples from the wxRuby site (  
[http://wxruby.rubyforge.org/wiki/wiki.pl?Getting\_Started](http://wxruby.rubyforge.org/wiki/wiki.pl?Getting_Started) )

Łukasz

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 5:48pm UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/11 "2010-11-07T17:48:39Z")

</div>

I tried the Minimal App with the lowercase wx and it gave me no debug  
errors but when I tried to run it it said:

/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)  
/home/crystalmoth/RubymineProjects/wxRuby\_CADaver/.idea/MainFrame.rb  
/home/crystalmoth/.gem/ruby/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so:  
/home/crystalmoth/.gem/ruby/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so:  
wrong ELF class: ELFCLASS32 -  
/home/crystalmoth/.gem/ruby/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so  
(LoadError)  
from /usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in `require' from /home/crystalmoth/.gem/ruby/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx.rb:12 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in`gem\_original\_require’  
from /usr/lib/ruby/1.8/rubygems/custom\_require.rb:36:in `require' from /home/crystalmoth/RubymineProjects/wxRuby_CADaver/.idea/MainFrame.rb:4 from -e:1:in`load’  
from -e:1

Process finished with exit code 1

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [November 7, 2010, 4:20pm UTC](https://www.ruby-forum.com/t/cannot-get-my-wx-script-to-run/198717/12 "2010-11-07T16:20:24Z")

</div>

I tried those lines of path code. It didn’t give me any errors, but then  
I tried running it from the terminal and got this message:

/usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in  
'gem\_original\_require: no such file to load --Wx (LoadError)  
from /usr/lib/ruby/1.8/rubygems/custom\_require.rb:31:in  
‘require’  
from MainFrame.rb:4

And I am using Ubuntu Lucid Lynx.

I’ve attached the custom require file and my code.

Under /usr/lib/Ruby I seem to have the folders 1.8, 1.9, 1.9.0, 1.9.1,  
and gems

Could there be a conflict of different versions going on.
