Getting “uninitialized constant Zookeeper (NameError)” while trying to use zookeeper gem

StackOverflow https://stackoverflow.com/questions/3876309

  •  28-09-2019
  •  | 
  •  

Question

I'm trying to use zookeeper gem and example code from README fails:

require 'rubygems'
require 'zookeeper'
z = Zookeeper.new("localhost:2181")
z.get_children(:path => "/")

causes error:

./zookeeper.rb:3: uninitialized constant Zookeeper (NameError)
 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
 from zookeeper.rb:2

I'm googling and looking code and I really have no idea what to do...

Was it helpful?

Solution

Don't call your file zookeeper.rb .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top