我是Riak的新手,这是我在irb中尝试过的红宝石代码:
irb(main):002:0> c = Riak::Client.new
=> #<Riak::Client http://127.0.0.1:8098>
irb(main):003:0> obj = c['videos']['first']
RuntimeError: The NetHTTP HTTP backend cannot be used. Please check its requirements.
from /usr/local/lib/ruby/gems/1.9.1/gems/riak-client-0.9.8/lib/riak/client.rb:247:in `http'
from /usr/local/lib/ruby/gems/1.9.1/gems/riak-client-0.9.8/lib/riak/client.rb:276:in `backend'
from /usr/local/lib/ruby/gems/1.9.1/gems/riak-client-0.9.8/lib/riak/bucket.rb:102:in `get'
from (irb):3
from /usr/local/bin/irb:12:in `<main>'
我怎么能解决这个问题?
谢谢,祝节日快乐!
答案 0 :(得分:3)
我遇到了此错误消息,因为我指定的端口号与Riak使用的端口号不同:
client = Riak::Client.new(:port => 8091, :http_backend => :Excon)
也许Riak正在为您运行不同的端口或根本不运行。为了解决这个问题,我刚刚删除了端口号:
client = Riak::Client.new(:http_backend => :Excon)
答案 1 :(得分:0)
错误消息清楚地表明它缺少要求。 您应该根据documentation安装它们,或者只是尝试另一个后端。