Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.5
-
Fix Version/s: JRuby 1.2
-
Component/s: Interpreter
-
Labels:None
-
Environment:ubuntu 8.10 64bit, java version "1.6.0_04" 32bit, jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-06 rev 6586) [i386-java]
Description
I was doing some simple tests and named my file "thread.rb". In this file I required "thread" library and surprisingly it worked in ruby 1.8.6, 1.8.7, 1.9 but not in JRuby 1.1.5. I know that I shouldn't name my file as one of ruby std library name but I think that it should work the same way for all ruby interpreters.
require "thread"
puts Mutex
$ ruby1.8.6 -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux]
$ ruby1.8.6 thread.rb
Mutex
$ ruby1.8 -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
$ ruby1.8 thread.rb
Mutex
$ ruby1.9 -v
ruby 1.9.0 (2008-11-07 revision 20129) [x86_64-linux]
$ ruby1.9 thread.rb
Mutex
$ jruby -v
jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-06 rev 6586) [i386-java]
$ jruby thread.rb
null:1:in `const_missing': uninitialized constant Mutex (NameError)
from thread.rb:3
from thread.rb:1:in `require'
from thread.rb:1
I'm not sure if this was fixed in 1.1.6 or 1.2, so I'll mark it for 1.2. It works fine now; we were using cwd for load/require in too many places.