gpt4 book ai didi

ruby-on-rails - 在 Nitrous.io 上安装 ElasticSearch?

转载 作者:行者123 更新时间:2023-12-02 22:16:12 26 4
gpt4 key购买 nike

我正在尝试在 Nitrous.io 上使用 Elasticsearch。

我正在关注this tutorial但是当尝试重新索引模型时,我收到此错误

action@learning-rails-1868:~/fayl$ rake searchkick:reindex CLASS=Fail                                                                                                     
rake aborted!
Connection refused - connect(2)
/home/action/.rvm/gems/ruby-1.9.3-p374/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/home/action/.rvm/gems/ruby-1.9.3-p374/gems/rest-client- 1.6.7/lib/restclient/request.rb:64:in `execute'
/home/action/.rvm/gems/ruby-1.9.3-p374/gems/tire-0.6.0/lib/tire/http/client.rb:11:in `get'
/home/action/.rvm/gems/ruby-1.9.3-p374/gems/searchkick-0.2.8/lib/searchkick/reindex.rb:43:in `clean_indices'
/home/action/.rvm/gems/ruby-1.9.3-p374/gems/searchkick-0.2.8/lib/searchkick/reindex.rb:10:in `reindex'
/home/action/.rvm/gems/ruby-1.9.3-p374/gems/searchkick-0.2.8/lib/searchkick/tasks.rb:10:in `block (2 levels) in <top (required)>'
/home/action/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `eval'
/home/action/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => searchkick:reindex

我不确定是否已在 Nitrous.io 上正确安装 Elasticsearch。有人成功地做到了这一点吗?或者您能指出如何实现这一点的指南吗?

最佳答案

我还没有尝试过 nitrous.io,但您需要告诉 Searchkick 在哪里可以找到 Elasticsearch。

使用以下内容创建初始化程序config/initializers/elasticsearch.rb:


ENV["ELASTICSEARCH_URL"] = "http://用户名:密码@主机名"

您还可以使用托管版本,例如 Searchly .

关于ruby-on-rails - 在 Nitrous.io 上安装 ElasticSearch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19320063/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com