hbase shell: TypeError: can't dup NilClass

2019-07-18 05:47发布

问题:

I'm getting this strange error when trying to launch hbase shell. I'm using CDH5.

# hbase shell
TypeError: can't dup NilClass
         dup at org/jruby/RubyKernel.java:1940
  initialize at file:/usr/lib/hbase/lib/jruby-complete-1.6.8.jar!/META-INF/jruby.home/lib/ruby/1.8/pathname.rb:212
      (root) at /usr/lib/hbase/bin/../bin/hirb.rb:41

Has it occurred to anyone? How can I resolve this?

回答1:

I faced a similar exception. The reason was because, my older version of hbase was actually pointed in the path. so when I type hbase shell, the older hbase was invoked. I corrected my environment variables properly and pointed it to new hbase, then it was working fine. So yours will be also similar issue.

export HBASE_HOME=<add the proper path to hbase-dir>
export PATH=$HBASE_HOME/bin:$PATH

This worked for me.



标签: ruby hbase