jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-3128

Different jruby behaviour that ruby 1.8.6/1.8.7/1.9 when running file that is named as one of required file.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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.

thread.rb
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

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    thread.rb
    09/Nov/08 3:45 PM
    0.0 kB
    Radoslaw Bulat

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 12/Feb/09 3:22 AM

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.

Show
Charles Oliver Nutter added a comment - 12/Feb/09 3:22 AM 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.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Radoslaw Bulat
Vote (0)
Watch (0)

Dates

  • Created:
    09/Nov/08 3:45 PM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    12/Feb/09 3:22 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.