wxruby problem

Discussion in 'Ruby' started by Haris Bogdanoviæ, Sep 19, 2009.

  1. Hi.Line 2 produces an error:1 require "wx"
    2 include Wx

    after starting I get this:

    uninitialized constant Wx (NameError)
    from wx.rb:1:in `require'
    from wx.rb:1
    >Exit code: 1

    Can you tell me why is this happening ?Thanks.
     
    Haris Bogdanoviæ, Sep 19, 2009
    #1
    1. Advertisements

  2. "Haris Bogdanoviæ" <> wrote in message
    news:h9352r$1fq$...
    > Hi.Line 2 produces an error:1 require "wx"
    > 2 include Wx
    >
    > after starting I get this:
    >
    > uninitialized constant Wx (NameError)
    > from wx.rb:1:in `require'
    > from wx.rb:1
    >>Exit code: 1

    > Can you tell me why is this happening ?Thanks.


    Why is my text all scrambled ? I use outlook express
    >
    >
     
    Haris Bogdanoviæ, Sep 19, 2009
    #2
    1. Advertisements

  3. Haris Bogdanoviæ

    Tim Hunter Guest

    Haris Bogdanoviæ wrote:
    > Hi.Line 2 produces an error:1 require "wx"
    > 2 include Wx
    >
    > after starting I get this:
    >
    > uninitialized constant Wx (NameError)
    > from wx.rb:1:in `require'
    > from wx.rb:1
    >> Exit code: 1

    > Can you tell me why is this happening ?Thanks.


    Any chance your test program is named wx.rb? If so, change it.

    --
    MagickWand for Ruby - http://magickwand.rubyforge.org/
     
    Tim Hunter, Sep 19, 2009
    #3
  4. I named my file wx.rb.
    That was the cause.
    Can anybody explain why ?
    Doesn't really matter know but I would like to know anyway.

    Thanks.


    "Haris Bogdanoviæ" <> wrote in message
    news:h9352r$1fq$...
    > Hi.Line 2 produces an error:1 require "wx"
    > 2 include Wx
    >
    > after starting I get this:
    >
    > uninitialized constant Wx (NameError)
    > from wx.rb:1:in `require'
    > from wx.rb:1
    >>Exit code: 1

    > Can you tell me why is this happening ?Thanks.
    >
     
    Haris Bogdanoviæ, Sep 19, 2009
    #4
  5. Haris Bogdanoviæ

    Tim Hunter Guest

    Haris Bogdanoviæ wrote:
    > I named my file wx.rb.
    > That was the cause.
    > Can anybody explain why ?
    > Doesn't really matter know but I would like to know anyway.
    >


    Because Ruby looks in your current directory for files that you require,
    so when you required 'wx' it found your test file. You can find out what
    directories Ruby searches by running this command:

    ruby -e"puts $:"

    --
    MagickWand for Ruby - http://magickwand.rubyforge.org/
     
    Tim Hunter, Sep 19, 2009
    #5
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke A. Guest

    wxRuby License

    Luke A. Guest, Jun 30, 2003, in forum: Ruby
    Replies:
    0
    Views:
    174
    Luke A. Guest
    Jun 30, 2003
  2. Andreas Schwarz
    Replies:
    5
    Views:
    224
  3. RaW

    wxRuby problem on Ubuntu

    RaW, Sep 29, 2005, in forum: Ruby
    Replies:
    7
    Views:
    303
    Daniel Lewis
    Sep 30, 2005
  4. kazaam
    Replies:
    2
    Views:
    239
    Stefano Crocco
    Aug 23, 2007
  5. Victor Reyes

    Problem loading wxruby

    Victor Reyes, Apr 3, 2008, in forum: Ruby
    Replies:
    2
    Views:
    180
    Victor Reyes
    Apr 3, 2008
  6. Marvin Gülker
    Replies:
    0
    Views:
    218
    Marvin Gülker
    Apr 3, 2009
  7. Rainer

    wxruby problem

    Rainer, Jul 29, 2009, in forum: Ruby
    Replies:
    7
    Views:
    252
    Rainer
    Jul 30, 2009
  8. Pen Ttt

    wxruby install problem

    Pen Ttt, Apr 25, 2010, in forum: Ruby
    Replies:
    3
    Views:
    360
    Marvin Gülker
    Apr 25, 2010
Loading...