我正在尝试使用zookeeper gem,来自README的示例代码失败:
require 'rubygems'
require 'zookeeper'
z = Zookeeper.new("localhost:2181")
z.get_children(:path => "/")
导致错误:
./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
我正在使用Google搜索并查找代码,我真的不知道该怎么做......
答案 0 :(得分:4)
请勿调用您的文件zookeeper.rb。