Ruby 1.9 and the Queue class

A

Aldric Giacomoni

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

Heesob Park

2009/4/13 Aldric Giacomoni said:
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
 
A

Aldric Giacomoni

Ah-ha! Thank you!

--Aldric

Heesob said:
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
 
R

Robert Klemme

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
 
S

Saji N. Hameed

* Robert Klemme said:
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 (e-mail address removed)
Fax: +82-51-745-3999
 
T

trans

2009/4/13 Aldric Giacomoni <"aldric[removeme]"@trevoke.net>:> Using Gento=
o - just unmasked Ruby 1.9 and emerged it (aka compile/install).
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.
 

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

Similar Threads

class context 1
rio and ruby 1.9 0
parentheses and newlines 2
Digest::Base problem 22
Ruby 1.9.1 built-in JSON troubles 5
Default encoding in ruby 1.9 2
Help needed for Ruby & Watir Configuration 1
1.9 bug? 3

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top