Ruby 1.9 and the Queue class

Discussion in 'Ruby' started by Aldric Giacomoni, Apr 13, 2009.

  1. Using Gentoo - just unmasked Ruby 1.9 and emerged it (aka compile/install).
    $ irb
    irb(main):001:0> a = Queue.new
    NameError: uninitialized constant Queue
    from (irb):1
    from /usr/bin/irb:12:in `<main>'
    irb(main):002:0>

    What gives ?
    If I switch to Ruby 1.8 and do the same thing, I get a new queue..


    --
    Aldric Giacomoni<br>
    The problem of leadership is inevitably: Who will play God?

    -- Muad'Dib. From the Oral History
    Aldric Giacomoni, Apr 13, 2009
    #1
    1. Advertising

  2. Aldric Giacomoni

    Heesob Park Guest

    2009/4/13 Aldric Giacomoni <"aldric[removeme]"@trevoke.net>:
    > Using Gentoo - just unmasked Ruby 1.9 and emerged it (aka compile/install=

    ).
    > $ irb
    > irb(main):001:0> a =3D Queue.new
    > NameError: uninitialized constant Queue
    > =C2=A0 =C2=A0 =C2=A0 =C2=A0from (irb):1
    > =C2=A0 =C2=A0 =C2=A0 =C2=A0from /usr/bin/irb:12:in `<main>'
    > irb(main):002:0>
    >
    > What gives ?
    > If I switch to Ruby 1.8 and do the same thing, I get a new queue..
    >

    require 'thread' first.


    Regards,

    Park Heesob
    Heesob Park, Apr 13, 2009
    #2
    1. Advertising

  3. Ah-ha! Thank you!

    --Aldric

    Heesob Park wrote:
    > 2009/4/13 Aldric Giacomoni <"aldric[removeme]"@trevoke.net>:
    >> Using Gentoo - just unmasked Ruby 1.9 and emerged it (aka compile/install).
    >> $ irb
    >> irb(main):001:0> a = Queue.new
    >> NameError: uninitialized constant Queue
    >> from (irb):1
    >> from /usr/bin/irb:12:in `<main>'
    >> irb(main):002:0>
    >>
    >> What gives ?
    >> If I switch to Ruby 1.8 and do the same thing, I get a new queue..
    >>

    > require 'thread' first.
    >
    >
    > Regards,
    >
    > Park Heesob
    >


    --
    Aldric Giacomoni<br>
    Governments, if they endure, always tend increasingly toward aristocratic forms.
    No government in history has been known to evade this pattern. And as the
    aristocracy develops, government tends more and more to act exclusively in
    the interests of the ruling class -- whether that class be hereditary royalty,
    oligarchs of financial empires, or entrenched bureaucracy.

    -- Politics as Repeat Phenomenon: Bene Gesserit Training Manual
    Aldric Giacomoni, Apr 13, 2009
    #3
  4. On 13.04.2009 03:12, Aldric Giacomoni wrote:
    > Using Gentoo - just unmasked Ruby 1.9 and emerged it (aka compile/install).
    > $ irb
    > irb(main):001:0> a = Queue.new
    > NameError: uninitialized constant Queue
    > from (irb):1
    > from /usr/bin/irb:12:in `<main>'
    > irb(main):002:0>
    >
    > What gives ?
    > If I switch to Ruby 1.8 and do the same thing, I get a new queue..


    Not for me:

    robert@fussel ~
    $ allruby -e 'p Queue'
    ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
    -e:1: uninitialized constant Queue (NameError)
    ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-cygwin]
    -e:1:in `<main>': uninitialized constant Queue (NameError)

    robert@fussel ~
    $ allruby -r thread -e 'p Queue'
    ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
    Queue
    ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-cygwin]
    Queue

    robert@fussel ~
    $

    Do you maybe have some default require which requires "thread"?

    Kind regards

    robert


    --
    remember.guy do |as, often| as.you_can - without end
    Robert Klemme, Apr 13, 2009
    #4
  5. * Robert Klemme <> [2009-04-13 20:30:07 +0900]:

    >> What gives ?
    >> If I switch to Ruby 1.8 and do the same thing, I get a new queue..

    >
    > Not for me:
    >
    > robert@fussel ~
    > $ allruby -e 'p Queue'
    > ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
    > -e:1: uninitialized constant Queue (NameError)
    > ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-cygwin]
    > -e:1:in `<main>': uninitialized constant Queue (NameError)
    >
    > Do you maybe have some default require which requires "thread"?


    hmmm... not for me ;-(

    ruby -v
    ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
    [saji@apcc08 Personal]$ ruby -e 'p Queue'
    Queue

    saji
    --

    --
    Saji N. Hameed

    APEC Climate Center
    1463 U-dong, Haeundae-gu, +82 51 745 3951
    BUSAN 612-020, KOREA
    Fax: +82-51-745-3999
    Saji N. Hameed, Apr 14, 2009
    #5
  6. Aldric Giacomoni

    trans Guest

    On Apr 12, 9:54=A0pm, Heesob Park <> wrote:
    > 2009/4/13 Aldric Giacomoni <"aldric[removeme]"@trevoke.net>:> Using Gento=

    o - just unmasked Ruby 1.9 and emerged it (aka compile/install).
    > > $ irb
    > > irb(main):001:0> a =3D Queue.new
    > > NameError: uninitialized constant Queue
    > > =A0 =A0 =A0 =A0from (irb):1
    > > =A0 =A0 =A0 =A0from /usr/bin/irb:12:in `<main>'
    > > irb(main):002:0>

    >
    > > What gives ?
    > > If I switch to Ruby 1.8 and do the same thing, I get a new queue..

    >
    > require 'thread' first.


    Seems like it would be good to put that in it's own require.

    require 'queue'

    And thread.rb can require that.

    T.
    trans, Apr 14, 2009
    #6
    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. Paul L. Du Bois

    Queue.Queue-like class without the busy-wait

    Paul L. Du Bois, Mar 24, 2005, in forum: Python
    Replies:
    29
    Views:
    1,039
    Antoon Pardon
    Apr 4, 2005
  2. Russell Warren

    Is Queue.Queue.queue.clear() thread-safe?

    Russell Warren, Jun 22, 2006, in forum: Python
    Replies:
    4
    Views:
    668
    Russell Warren
    Jun 27, 2006
  3. Kceiw
    Replies:
    3
    Views:
    982
    Jim Langston
    Mar 14, 2006
  4. Frank Millman
    Replies:
    3
    Views:
    336
    Frank Millman
    Feb 9, 2010
  5. Kris
    Replies:
    0
    Views:
    466
Loading...

Share This Page