Problem loading wxruby

Team,

I installed wxruby via gem install.
I successfully installed it but I can load it via require.

C:$user\ruby\Programs\GUI and Graphs>*ruby -v
*ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:$user\ruby\Programs\GUI and Graphs>gem install wxruby
Select which gem to install for your platform (i386-mswin32)

  1. wxruby 1.9.5 (universal-darwin-9)
  2. wxruby 1.9.5 (i386-mswin32)
  3. wxruby 1.9.5 (x86-linux)
  4. wxruby 1.9.5 (x86_64-linux)
  5. Skip this gem
  6. Cancel installation

2
Successfully installed wxruby-1.9.5-i386-mswin32

C:$user\ruby\Programs\GUI and Graphs>*ruby rdg02.rb
*rdg02.rb:1:in `require’: no such file to load – wx (LoadError)
from rdg02.rb:1

Any help is appreciated!

Victor

I had it in reverse order.

Thank you

Victor

On Apr 3, 3:04 pm, Victor R. [email protected] wrote:

C:$user\ruby\Programs\GUI and Graphs>gem install wxruby
C:$user\ruby\Programs\GUI and Graphs>*ruby rdg02.rb
*rdg02.rb:1:in `require’: no such file to load – wx (LoadError)
from rdg02.rb:1

Any help is appreciated!

Did you tried require ‘rubygems’ first?

Since you installed via Gems, most likely you don’t have RUBYOPT set
to rubygems, which automatically loaded rubygems for you.

try this:

require ‘rubygems’
require ‘wx’

on top of your script. That should fix what you’re getting.

HTH,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs