Forum: JRuby NameError: uninitialized constant IRB::Irb

98f034249f43fc242a9e9baddfd4c989?d=identicon&s=25 Aaron Sun (Guest)
on 2013-07-21 20:10
(Received via mailing list)
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
F1d37642fdaa1662ff46e4c65731e9ab?d=identicon&s=25 Charles Nutter (headius)
on 2013-07-24 00:43
(Received via mailing list)
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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.