繁体   English   中英

Elasticsearch :: Transport :: Transport :: Errors :: NotAcceptable:[406] {“错误”:“不支持Content-Type标头[]”,“状态”:406}

[英]Elasticsearch::Transport::Transport::Errors::NotAcceptable: [406] {“error”:“Content-Type header [] is not supported”,“status”:406}

我正在尝试运行一个项目,但是任何使用弹性搜索的应用均会因以下错误而崩溃:

Elasticsearch::Transport::Transport::Errors::NotAcceptable: [406] {"error":"Content-Type header [] is not supported","status":406}
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/transport/base.rb:201:in `__raise_transport_error'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/transport/base.rb:312:in `perform_request'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/client.rb:128:in `perform_request'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-api-2.0.0/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/elasticsearch-api-2.0.0/lib/elasticsearch/api/actions/indices/create.rb:84:in `create'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/index.rb:13:in `create'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/index.rb:147:in `create_index'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/index.rb:198:in `reindex_scope'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/model.rb:53:in `searchkick_reindex'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/tasks.rb:26:in `block (4 levels) in <top (required)>'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/tasks.rb:24:in `each'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/searchkick-1.4.0/lib/searchkick/tasks.rb:24:in `block (3 levels) in <top (required)>'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/bugsnag-6.2.0/lib/bugsnag/integrations/rake.rb:16:in `execute_with_bugsnag'
/Users/bob/.rvm/gems/ruby-2.4.3/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/Users/bob/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:15:in `eval'
/Users/bob/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:15:in `<main>'

我不知道发生了什么。 我已经通过brew install elasticsearch@2.4进行了brew install elasticsearch@2.4并通过brew services start elasticsearch@2.4

有任何想法吗?

我终于到了那里。 对于其他有此问题的人:

您可能需要特定版本的elasticsearch(我需要2.4):

  • brew uninstall elasticsearch
  • brew install elasticsearch@2.4
  • pkill -f elasticsearch #特定于OSX
  • brew services start elasticsearch@2.4您可能需要等待几分钟
  • curl 'http://localhost:9200/?pretty' #测试弹性搜索是否已启动并正在运行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM