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. Advertising

  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. Advertising

  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. Advertising

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. Andreas Schwarz
    Replies:
    5
    Views:
    105
  2. RaW

    wxRuby problem on Ubuntu

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

    Problem loading wxruby

    Victor Reyes, Apr 3, 2008, in forum: Ruby
    Replies:
    2
    Views:
    109
    Victor Reyes
    Apr 3, 2008
  5. Marvin Gülker
    Replies:
    0
    Views:
    133
    Marvin Gülker
    Apr 3, 2009
Loading...

Share This Page