From: Stefan Mahlitz Date: 2007-08-23T03:49:01+09:00 Subject: Re: wxruby and rubygems seems not to work? kazaam wrote: > Like here: http://wxruby.rubyforge.org/wiki/wiki.pl?Installation suggested I installed wxruby2 on my linux machine with: > sudo gem install wxruby2-preview > Then I tried this sample: http://wxruby.rubyforge.org/wiki/wiki.pl?Getting_Started , I modified it to run for me: > > #!/usr/bin/env ruby > > $Verbose=true > > require 'rubygems' > gem 'wxruby2-preview' > > > class MinimalApp < App > def on_init > Frame.new(nil, -1, "The Bare Minimum").show() > end > end > > > MinimalApp.new.main_loop > > but always when I execute it I'm getting this error: > laptop:~/Desktop$ ./gui.rb > ./gui.rb:9: uninitialized constant App (NameError) > laptop:~/Desktop$ You missed two lines of the tutorial: require "wx" # wxruby2 include Wx they should be placed below your require "rubygems" If you leave out 'include Wx' you will have to write Wx::App, Wx::Frame etc. Stefan