NameError: uninitialized constant IRB::Irb

Hi,

I am totally new to both Ruby and JRuby. In fact I met this problem when
I
was trying to debug HBase, which has a shell - hirb.rb - written in
Ruby.

The file hirb.rb contains a class HIRB which subclasses IRB as follows

“”"
module IRB

class HIRB < Irb
“”"

However, the execution of hirb.rb using JRuby (jruby-complete-1.6.5.jar)
returns the error

NameError: uninitialized constant IRB::Irb
const_missing at org/jruby/RubyModule.java:2590

I am using Windows 7 as the dev environment, and no Ruby environment was
installed. The execution is through running org.jruby.Main with the path
of
hirb.rb as the input.

Thanks
Aaron

It sounds like it’s not loading the “irb” library, or that library
isn’t in jruby-complete properly.

The following works ok for me on JRuby master…perhaps you can try
adding “require ‘irb’” to the code?

$ jruby -e 'require "irb"; p IRB; p IRB::Irb'
IRB
IRB::Irb
  • Charlie