[英]Installing ElasticSearch on Nitrous.io?
I'm trying to use Elasticsearch on Nitrous.io. 我正在尝试在Nitrous.io上使用Elasticsearch。
I'm following this tutorial but when trying to reindex the model I get this error 我正在按照本教程进行操作,但是在尝试为模型重新编制索引时出现此错误
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
I'm not sure I've installed Elasticsearch on Nitrous.io properly. 我不确定是否已在Nitrous.io上正确安装了Elasticsearch。 Has anyone managed to do this successfully? 有人成功做到了吗? Or can you point to a guide for how to implement this? 或者您可以指向如何实现此目标的指南?
I haven't tried nitrous.io, but you'll need to tell Searchkick where to find Elasticsearch. 我还没有尝试过nitrosous.io,但是您需要告诉Searchkick在哪里可以找到Elasticsearch。
Create an initializer config/initializers/elasticsearch.rb
with: 使用以下命令创建一个初始化程序config/initializers/elasticsearch.rb
:
ENV["ELASTICSEARCH_URL"] = "http://username:password@hostname"
You could also use a hosted version like Searchly . 您还可以使用Searchly之类的托管版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.