I''m new to Ruby and wxRuby, and I just installed Ruby 185-21 (I run
WinXP),
then used gem to install wxRuby2. When I try to run a short test program
(included below), I get this error:
C:\Documents and Settings\Mike\Desktop>ruby test.rb
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'': no such file to load -- wxruby (LoadError)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require''
from test.rb:1
Here''s the test program:
----- START OF PROGRAM
require "wxruby"
ID_ICON = 1000
class IconFrame < Wx::Frame
def initialize
super(nil, -1, "Changing Icons!", Wx::DEFAULT_POSITION,
Wx::Size.new
(225,150))
panel = Wx::Panel.new(self, -1)
iconNames = ["wxwin", "mondrian", "ogl",
"smiley"]
icons = Wx::RadioBox.new(panel, ID_ICON, "&Icons",
Wx::Point.new
(20,5),
Wx::DEFAULT_SIZE, iconNames, 1,
Wx::RA_SPECIFY_COLS)
evt_radiobox(ID_ICON) {|event| on_change_icon(event)}
if Wx::RUBY_PLATFORM == "WXMSW"
set_icon(Wx::Icon.new("./icons/wxwin.ico"))
else
set_icon(Wx::Icon.new("./icons/wxwin16x16.xpm"))
end
show(true) #true is the default value, so it may be left off
end
def on_change_icon(event)
if Wx::RUBY_PLATFORM == "WXMSW"
case event.get_int
when 0
set_icon(Wx::Icon.new("./icons/wxwin.ico"))
when 1
set_icon(Wx::Icon.new("./icons/mondrian.ico"))
when 2
set_icon(Wx::Icon.new("./icons/ogl.ico"))
when 3
set_icon(Wx::Icon.new("./icons/smiley.ico"))
end
else
case event.get_int
when 0
set_icon(Wx::Icon.new("./icons/wxwin16x16.xpm"))
when 1
set_icon(Wx::Icon.new("./icons/mondrian.xpm"))
when 2
set_icon(Wx::Icon.new("./icons/ogl.xpm"))
when 3
set_icon(Wx::Icon.new("./icons/smiley.xpm"))
end
end
end
end
class MinimalApp < Wx::App
def on_init
IconFrame.new
end
end
MinimalApp.new.main_loop
----- END OF PROGRAM
_______________________________________________
wxruby-users mailing list
wxruby-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
Alex Fenton
2007-Jan-30 09:33 UTC
[Wxruby-users] error finding library when running test program
Hi Mike Steiner wrote:> I''m new to Ruby and wxRuby,Welcome> and I just installed Ruby 185-21 (I run WinXP), then used gem to > install wxRuby2.<snip>> ----- START OF PROGRAM > require "wxruby"# This should be require ''wx'' Please let us know where you saw the old style ''require "wxruby"''. The samples (which will be installed in somewhere like C:/ruby/lib/gem/1.8/wxruby2-preview/samples) are a good place to start. Also, if you''re using XP, you will probably want to add GC.disable at the start of your scripts or you will probably experience crashes with the current preview gem. cheers alex
Mike Steiner
2007-Jan-30 16:09 UTC
[Wxruby-users] error finding library when running test program
Thanks for the help. I noticed that the sample script was also looking for some icon files, so I gave up on that one. After looking at (again) http://wxruby.rubyforge.org/wiki/wiki.pl?Installation I ran minimal.rb and it worked great! So at the end I have something that works, which I can now build on, so I''m happy. Mike On 1/30/07, Alex Fenton <alex at pressure.to> wrote:> > Hi > > Mike Steiner wrote: > > I''m new to Ruby and wxRuby, > Welcome > > and I just installed Ruby 185-21 (I run WinXP), then used gem to > > install wxRuby2. > <snip> > > ----- START OF PROGRAM > > require "wxruby" > # This should be > > require ''wx'' > > > Please let us know where you saw the old style ''require "wxruby"''. The > samples (which will be installed in somewhere like > C:/ruby/lib/gem/1.8/wxruby2-preview/samples) are a good place to start. > > Also, if you''re using XP, you will probably want to add > > GC.disable > > at the start of your scripts or you will probably experience crashes > with the current preview gem. > > cheers > alex > _______________________________________________ > 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/20070130/b137656b/attachment.html
Apparently Analagous Threads
- [871] trunk/wxruby2/samples/printing/printing.rb: Enable sample to be run from other directories
- TaskBarIcon gives Typerror
- [1103] trunk/wxruby2: Added 2.8 methods to StaticBitmap & document them; cleanup header file
- [ wxruby-Bugs-24288 ] rb_str2cstr undefined with Ruby 1.9 and Ubuntu Linux
- Can''t change button-size?