简体   繁体   English

如何在新的Nitrous.io IDE上设置SearchKick / ElasticSearch?

[英]How do I setup SearchKick/ElasticSearch on the NEW Nitrous.io IDE?

I am following the McKenzie Childs tutorial on making a "Movie Review" app on Ruby on Rails and he is using the searchkick gem. 我正在关注McKenzie Childs关于在Ruby on Rails上制作“电影评论”应用程序的教程,他正在使用searchkick gem。 I am doing everything through the new Nitrous platform and everything is confusing. 我正在通过新的Nitrous平台做一切,一切都令人困惑。

I was running this command to: 我正在运行此命令:

rake searchkick:reindex CLASS=Movie 

and got the following error in the shell: 并在shell中出现以下错误:

rake aborted!
Faraday::ConnectionFailed: Connection refused - connect(2) for "localhost"port 9200
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:80:in `perform_request'
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:40:in `block in call'
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:32:in `call'
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/elasticsearch-transport-1.0.12/lib/elasticsearch/transport/transport/http/faraday.rb:21:in `block in perform_request'
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/elasticsearch-transport-1.0.12/lib/elasticsearch/transport/transport/base.rb:190:in `call'

Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 9200
/home/nitrous/code/12_in_12/movie_review/.bundle/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:80:in `perform_request'

I have a feeling that its something in regards to connecting a port or starting some server. 我有一种关于连接端口或启动服务器的感觉。 This is the first month of the new Nitrous Web IDE. 这是新的Nitrous Web IDE的第一个月。

Did the tutorial yesterday and ran into the same issue(was using cloud9 IDE). 昨天的教程是否遇到了同样的问题(使用的是cloud9 IDE)。 I noticed I was getting that error because elastic search wasn't running. 我注意到我收到了这个错误,因为弹性搜索没有运行。 I uninstalled it using the command 我使用命令卸载它

sudo apt-get --purge autoremove elasticsearch

then made a fresh install. 然后重新安装。

wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.7.0.deb
sudo dpkg -i elasticsearch-1.7.0.deb

#enable on bootup
sudo update-rc.d elasticsearch defaults 95 10

### Start ElasticSearch 
sudo /etc/init.d/elasticsearch start

### Make sure service is running
curl http://localhost:9200

### Should return something like this:
# {
#  "status" : 200,
#  "name" : "Storm",
#  "version" : {
#    "number" : "1.3.1",
#    "build_hash" : "2de6dc5268c32fb49b205233c138d93aaf772015",
#    "build_timestamp" : "2014-07-28T14:45:15Z",
#    "build_snapshot" : false,
#    "lucene_version" : "4.9"
#  },
#  "tagline" : "You Know, for Search"
#}

Searchkick worked after this. Searchkick在此之后工作。 You should have java installed though before installing elastic search. 在安装弹性搜索之前,您应该安装java。 Hope this helps you 希望这对你有所帮助

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

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