我已经安装了红宝石2.0.0p195及以下的宝石红宝石 - 动物园管理员宝石版本错误的参数数目(3 4)(引发ArgumentError)
gem install net-ssh
gem install rdoc
gem install zookeeper
Ruby Zookeeper client installed successfully (ver - 1.4.4)
但是,当我执行示例Ruby脚本来检查节点存在并在zookeeper上创建节点:
require 'rubygems'
require 'zookeeper'
z = Zookeeper.new("localhost:2181")
if !z.exists("/app", :watch => true)
z.create("/app","app root node",:mode => :ephemeral)
end
z.get_children(:path => "/")
......它抛出以下错误。
zookeeper-1.4.4/lib/zookeeper/continuation.rb:172:in `zkrb_exists': wrong number of arguments (3 for 4) (ArgumentError)
from .rvm/gems/ruby-2.0.0-p195/gems/zookeeper-1.4.4/lib/zookeeper/continuation.rb:172:in `submit'
from .rvm/gems/ruby-2.0.0-p195/gems/zookeeper-1.4.4/ext/c_zookeeper.rb:303:in `submit_pending_calls'
from .rvm/gems/ruby-2.0.0-p195/gems/zookeeper-1.4.4/ext/c_zookeeper.rb:261:in `event_thread_body'
任何人都可以请帮我解决这个问题吗?
你能分享一些代码吗? – draxxxeus
需要 'RubyGems的' 需要 '饲养员' Z = Zookeeper.new( “本地主机:2181”)! 如果z.exists( “/应用”:手表=>真) z.create(“/应用程序“:”app root node“,:mode =>:ephemeral) end z.get_children(:path =>”/“) –