如何解决此错误:riak_client:RuntimeError:无法使用NetHTTP HTTP后端

发布于 2024-12-23 00:59:06 字数 687 浏览 1 评论 0原文

我是 Riak 的新手,这是我在 irb 中尝试的 ruby​​ 代码:

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>'

我怎样才能解决这个问题?

谢谢,节日快乐!

I'm new to Riak , Here's the ruby code I tried in 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>'

How could I solve this problem?

Thanks, and Happy Holidays!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

っ左 2024-12-30 00:59:06

我遇到此错误消息是因为我指定的端口号与 Riak 使用的端口号不同:

client  = Riak::Client.new(:port => 8091, :http_backend => :Excon)

也许 Riak 正在为您运行在不同的端口上或者根本没有运行。为了解决这个问题,我刚刚删除了端口号:

client = Riak::Client.new(:http_backend => :Excon)

I encountered this error message because I was specifying a port number different from the one Riak was using as such:

client  = Riak::Client.new(:port => 8091, :http_backend => :Excon)

Maybe Riak is running on a different port for you or not running at all. To fix this, I just removed the port number:

client = Riak::Client.new(:http_backend => :Excon)
灼痛 2024-12-30 00:59:06

错误消息清楚地表明它缺少要求。
您应该根据 文档 安装它们,或者尝试另一个后端。

The error message clearly says that it's missing the requirements.
You should install them according to documentation or maybe just try another backend.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文