Wxruby2 - Error Message

Hi all

I don’t understand what’s going wrong when I try to use the wxruby2…

I followed the http://wxruby.rubyforge.org/wiki/wiki.pl instructions but
I always get this error when I run the following code:

require “wxruby”
require “rubygems”
include Wx

class MinimalApp < App
def on_init
Frame.new(nil, -1, “The Bare Minimum”).show()
end
end

MinimalApp.new.main_loop

C:/Documentos/Ruby Scripts/form_01/lib/main.rb:1:in require': no such file to load -- wxruby (LoadError) from C:/Documentos/Ruby Scripts/form_01/lib/main.rb:1:in

I have ruby 1.9.1,Windows XP sp3 and I’m using NetBeans 6.8.

Thanks in advanced for any help

Ivo R.

Ivo R. wrote:

include Wx

Thanks in advanced for any help

Ivo R.

did you install it as a gem? try to require rubygems in the first line
then
wxruby on the second

Ivo R. wrote:

Hi all

I don’t understand what’s going wrong when I try to use the wxruby2…

I followed the http://wxruby.rubyforge.org/wiki/wiki.pl instructions but
I always get this error when I run the following code:

require “wxruby”
require “rubygems”
include Wx

class MinimalApp < App
def on_init
Frame.new(nil, -1, “The Bare Minimum”).show()
end
end

MinimalApp.new.main_loop

C:/Documentos/Ruby Scripts/form_01/lib/main.rb:1:in require': no such file to load -- wxruby (LoadError) from C:/Documentos/Ruby Scripts/form_01/lib/main.rb:1:in

I have ruby 1.9.1,Windows XP sp3 and I’m using NetBeans 6.8.

Thanks in advanced for any help

Ivo R.

Try

require “wx”

instead of

require “wxruby”

And move the require “rubygems” before the require “wx” statement.

Marvin

Make sure you installed wxruby for 1.9 instead of 1.8 “run gem install
wxruby-ruby19”

remove the require for rubygems because you are using 1.9.1
change the require ‘wxruby’ to require ‘wx’


Allan D.
Member of NetBeans Dream Team
http://wiki.netbeans.org/NetBeansDreamTeam
Lead Developer, nbPython
http://wiki.netbeans.org/Python
http://codesnakes.blogspot.com (my blog)
Co-Chair, CajunJUG
http://www.cajunjug.org

Allan D. wrote:

Make sure you installed wxruby for 1.9 instead of 1.8 “run gem install
wxruby-ruby19”

remove the require for rubygems because you are using 1.9.1
change the require ‘wxruby’ to require ‘wx’


Allan D.
Member of NetBeans Dream Team
http://wiki.netbeans.org/NetBeansDreamTeam
Lead Developer, nbPython
http://wiki.netbeans.org/Python
http://codesnakes.blogspot.com (my blog)
Co-Chair, CajunJUG
http://www.cajunjug.org

Allan

Finally it’s working…

Thanks you for your help.