Hi everyone, I''m new to wxRuby. I installed using "gem install wxruby" and it installed version 2.0.1, along with ri and rdoc documentation. I try to test it in irb, but I get this message: [code] irb(main):001:0> require ''wx'' LoadError: no such file to load -- wx from (irb):1:in `require'' from (irb):1 [/code] I also get an error message if I write this code in a text editor: [code] require "wx" include Wx class MinimalApp < App def on_init Frame.new(nil, -1, "The Bare Minimum").show() end end MinimalApp.new.main_loop [/code] Produces this: [code] ./wx.rb:2: uninitialized constant Wx (NameError) from wx.rb:1:in `require'' from wx.rb:1 [/code] I thought it had something to do with the wx_sugar gem so I uninstalled it using "gem uninstall wx_sugar", but the errors were still there. I am using Win XP Professional, and Ruby Installer 1.8.7. Please help! -- Posted via http://www.ruby-forum.com/.
I believe you have to require rubygems before you require wx On Thu, Aug 19, 2010 at 9:26 AM, tuti plain <lists at ruby-forum.com> wrote:> Hi everyone, > > I''m new to wxRuby. I installed using "gem install wxruby" and it > installed version 2.0.1, along with ri and rdoc documentation. I try > to test it in irb, but I get this message: > > [code] > irb(main):001:0> require ''wx'' > LoadError: no such file to load -- wx > from (irb):1:in `require'' > from (irb):1 > [/code] > > I also get an error message if I write this code in a text editor: > [code] > require "wx" > include Wx > > class MinimalApp < App > def on_init > Frame.new(nil, -1, "The Bare Minimum").show() > end > end > > > MinimalApp.new.main_loop > [/code] > > Produces this: > [code] > ./wx.rb:2: uninitialized constant Wx (NameError) > from wx.rb:1:in `require'' > from wx.rb:1 > [/code] > > I thought it had something to do with the wx_sugar gem so I > uninstalled it using "gem uninstall wx_sugar", but the errors were still > there. I am using Win XP Professional, and Ruby Installer 1.8.7. > Please help! > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20100819/6e5673d2/attachment-0001.html>
Bruce Loving wrote:> I believe you have to require rubygems before you require wxHi, I did as you suggested and got the following: NameError: uninitialized constant Wx from ./wx.rb:2 from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' This was using irb. -- Posted via http://www.ruby-forum.com/.
Hi, I tried using Ruby Installer 1.8.6 and now it works (after requiring rubygems as you suggested). It seems wxruby is incompatible with the newer versions. They should put that in the tutorial. Anyhoop, thanks so much. Now I can begin programming GUI in Ruby! -- Posted via http://www.ruby-forum.com/.
this works just fine for me. require ''rubygems'' require ''wx'' include Wx On Thu, Aug 19, 2010 at 11:15 AM, tuti plain <lists at ruby-forum.com> wrote:> Bruce Loving wrote: > > I believe you have to require rubygems before you require wx > > Hi, I did as you suggested and got the following: > > > NameError: uninitialized constant Wx > from ./wx.rb:2 > from > C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > from > C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > > This was using irb. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20100819/c8bd013f/attachment.html>
Heya Tuti, We provide a Installer program on our Projects page of RubyForge for Ruby 1.8.7, and wxRuby combined. The reason we have troubles with this, is cause the Ruby Installer project just went from MSVCRT compiler to the MINGW compiler. Different compilers have different methods in which to compile code, and export Library Routines, so binary extensions built for MSVCRT, isn''t compatible with MINGW. The same holds true on Ubuntu systems. Ubuntu version 8.10 and before earlier use gcc 3.3, which is incompatible with Ubuntu version 9.04 onwards, which uses gcc 4.0. We have to use different builds for < 8.10 compared to > 9.04. The main cause of this, is RubyGems isn''t very compiler aware, outside of the main compiler names, they don''t allow for Compiler versions in the naming scheme. So we have to package things a bit differently. In most cases, when you try to install a binary Gem, it won''t follow the compiler used, especially MINGW, as it just recently became popular with the adaptation of the Ruby One Click Installer project. You will find with our next wxRuby gem release, that it will be compiled for MINGW and GCC 4.0+. And then we''ll have to provide deprecated versions for older GCC Versions. I don''t know if we will still maintain a MSVCRT version for Windows, as that has not been decided yet. hth, Mario On Thu, Aug 19, 2010 at 11:22 AM, tuti plain <lists at ruby-forum.com> wrote:> Hi, > > I tried using Ruby Installer 1.8.6 and now it works (after requiring > rubygems as you suggested). It seems wxruby is incompatible with the > newer versions. They should put that in the tutorial. > > Anyhoop, thanks so much. Now I can begin programming GUI in Ruby! > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-- Mario Steele Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20100819/3a1e5553/attachment.html>
Thanks for the explanation Mario,> You will find with our next wxRuby gem release, that it will be compiled > for > MINGW and GCC 4.0+. And then we''ll have to provide deprecated versions > for > older GCC Versions. I don''t know if we will still maintain a MSVCRT > version > for Windows, as that has not been decided yet. > > hth, > > MarioI did not completely understand what you meant with this paragraph but I assume that you mean the next release will be compatible without requiring a separate build. I look forward to it. I do remember downloading a wx-ready ruby 1.9 installer from the wxRuby page in RubyForge a while back. Not sure if it''s still available. But I didn''t use it for long. Anyway, I''ll check it out again. In the meantime, I''m happy with 1.8.6. -- Posted via http://www.ruby-forum.com/.