获取“未初始化的常量 Zookeeper (NameError)”在尝试使用 Zookeeper gem 时
我正在尝试使用 zookeeper gem ,自述文件中的示例代码失败:
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
我正在谷歌搜索并且看着代码,我真的不知道该怎么办......
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要将您的文件命名为“zookeeper.rb”。
Don't call your file zookeeper.rb .