[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem loading wxruby

Victor Reyes

4/3/2008 6:05:00 PM

[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!

Victor

2 Answers

Luis Lavena

4/3/2008 7:02:00 PM

0

On Apr 3, 3:04 pm, Victor Reyes <victor.re...@gmail.com> wrote:
> [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,
--
Luis Lavena

Victor Reyes

4/3/2008 7:15:00 PM

0

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

I had it in reverse order.

Thank you

Victor

On Thu, Apr 3, 2008 at 3:10 PM, Luis Lavena <luislavena@gmail.com> wrote:

> On Apr 3, 3:04 pm, Victor Reyes <victor.re...@gmail.com> wrote:
> > [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,
> --
> Luis Lavena
>
>