Problem loading wxruby

V

Victor Reyes

[Note: parts of this message were removed to make it a legal post.]

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
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
 
L

Luis Lavena

[Note: parts of this message were removed to make it a legal post.]

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!

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,
 
V

Victor Reyes

[Note: parts of this message were removed to make it a legal post.]

I had it in reverse order.

Thank you

Victor

[Note: parts of this message were removed to make it a legal post.]

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!

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top