新手问题 cannot load such file -- nats/client (LoadError)

lianyutao · 2013年08月15日 · 2821 次阅读

代码: require "nats/client" NATS.start do #简单的消息接受 NATS.subscribe('foo'){|msg| puts "Msg received : '#{msg}'"} #简单的消息发送 NATS.publish('foo.bar.baz','hello world') #退定 sid=NATS.subscribe('bar'){|msg| puts "Msg received : '#{msg}'"} NATS.unsubscribe(sid) #请求 NATS.request('help'){|response| puts "Got a response :'#{response}'"} #回复 NATS.subscribe('help'){|msg,reply| NATS.publish(reply,"I'll help!")} NATS.stop

end

错误: /home/tao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- nats/client (LoadError)

from /home/tao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'

from /home/tao/workspace/RubyRDT/testnats815.rb:1:in `

'

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请 注册新账号