gpt4 book ai didi

ruby-on-rails - Errno::ECONNREFUSED 由于目标机器主动拒绝,无法建立连接。 - 在 Rails 应用程序中使用 connect(2) 进行 Mongodb 搜索

转载 作者:行者123 更新时间:2023-11-29 13:35:33 28 4
gpt4 key购买 nike

我正在尝试在 Windows 机器上设置我的 Rails 应用程序,我正在尝试测试它。但是,当我尝试使用 Mongo 和 Solr 进行搜索时,出现此错误:

Errno::ECONNREFUSED (No connection could be made because the target machine actively refused it. - connect(2)):
app/controllers/centers_controller.rb:384:in `center_search'
lib/ct_gems/dm-core-1.2.0/lib/dm-core.rb:263:in `block in repository'
lib/ct_gems/dm-core-1.2.0/lib/dm-core/repository.rb:114:in `scope'
lib/ct_gems/dm-core-1.2.0/lib/dm-core.rb:263:in `repository'


Rendered ruby-postgres/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms)
Rendered ruby-postgres/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (15.6ms)
Rendered ruby-postgres/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (234.0ms)

这些是我必须运行该应用程序的命令:

mongod
rails s
redis-server.exe
rake sunspot:solr:run

错误发生在我调用方法solr_search时。

这是启动 solr 时在命令提示符中的输出:

Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode, sharing)
2012-11-06 11:43:21.446:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
2012-11-06 11:43:21.552:INFO::jetty-6.1-SNAPSHOT
2012-11-06 11:43:21.763:INFO::Extract file:/C:/Users/Ger/Documents/web_dev/connectedtrips/ruby-postgres/ruby/1.9.1/bundler/g
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: solr home defaulted to 'solr/' (could not find system property or JNDI)
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to 'solr/'
Nov 06, 2012 11:43:22 AM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: solr home defaulted to 'solr/' (could not find system property or JNDI)
Nov 06, 2012 11:43:22 AM org.apache.solr.core.CoreContainer$Initializer initialize
INFO: looking for solr.xml: C:\Users\Ger\Documents\web_dev\connectedtrips\ruby-postgres\ruby\1.9.1\bundler\gems\sunspot-f8d9
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: solr home defaulted to 'solr/' (could not find system property or JNDI)
Nov 06, 2012 11:43:22 AM org.apache.solr.core.CoreContainer <init>
INFO: New CoreContainer: solrHome=solr/ instance=26947014
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to 'solr/'
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to 'solr\.\'
Nov 06, 2012 11:43:22 AM org.apache.solr.core.SolrConfig initLibs
INFO: Adding specified lib dirs to ClassLoader
Nov 06, 2012 11:43:22 AM org.apache.solr.core.Config getLuceneVersion
WARNING: the luceneMatchVersion is not specified, defaulting to LUCENE_24 emulation. You should at some point declare and re
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrConfig <init>
INFO: Using Lucene MatchVersion: LUCENE_24
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrConfig <init>
WARNING: Deprecated syntax found. <highlighting/> should move to <searchComponent/>
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrConfig <init>
INFO: Loaded SolrConfig: solrconfig.xml
Nov 06, 2012 11:43:23 AM org.apache.solr.schema.IndexSchema readSchema
INFO: Reading Solr Schema
Nov 06, 2012 11:43:23 AM org.apache.solr.schema.IndexSchema readSchema
INFO: Schema name=sunspot
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created string: org.apache.solr.schema.StrField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created tdouble: org.apache.solr.schema.TrieDoubleField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created rand: org.apache.solr.schema.RandomSortField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created : org.apache.solr.analysis.StandardTokenizerFactory
Nov 06, 2012 11:43:23 AM org.apache.solr.analysis.BaseTokenStreamFactory assureMatchVersion
WARNING: StandardTokenizerFactory is using deprecated LUCENE_24 emulation. You should at some point declare and reindex to a
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created : org.apache.solr.analysis.StandardFilterFactory
Nov 06, 2012 11:43:23 AM org.apache.solr.analysis.BaseTokenStreamFactory assureMatchVersion
WARNING: StandardFilterFactory is using deprecated LUCENE_24 emulation. You should at some point declare and reindex to at l
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created : org.apache.solr.analysis.LowerCaseFilterFactory
Nov 06, 2012 11:43:23 AM org.apache.solr.analysis.BaseTokenStreamFactory assureMatchVersion
WARNING: LowerCaseFilterFactory is using deprecated LUCENE_24 emulation. You should at some point declare and reindex to at
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created text: org.apache.solr.schema.TextField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created boolean: org.apache.solr.schema.BoolField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created date: org.apache.solr.schema.DateField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created sdouble: org.apache.solr.schema.SortableDoubleField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created sfloat: org.apache.solr.schema.SortableFloatField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created sint: org.apache.solr.schema.SortableIntField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created slong: org.apache.solr.schema.SortableLongField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created tint: org.apache.solr.schema.TrieIntField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created tfloat: org.apache.solr.schema.TrieFloatField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created tdate: org.apache.solr.schema.TrieDateField
Nov 06, 2012 11:43:23 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created location: org.apache.solr.schema.LatLonType
Nov 06, 2012 11:43:23 AM org.apache.solr.schema.IndexSchema readSchema
INFO: default search field is text
Nov 06, 2012 11:43:23 AM org.apache.solr.schema.IndexSchema readSchema
INFO: query parser default operator is AND
Nov 06, 2012 11:43:23 AM org.apache.solr.schema.IndexSchema readSchema
INFO: unique key field: id
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrCore <init>
INFO: [] Opening new SolrCore at solr\.\, dataDir=./solr/data\
Nov 06, 2012 11:43:23 AM org.apache.solr.core.JmxMonitoredMap <init>
INFO: No JMX servers found, not exposing Solr information with JMX.
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrCore initListeners
INFO: [] Added SolrEventListener for newSearcher: org.apache.solr.core.QuerySenderListener{queries=[]}
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrCore initListeners
INFO: [] Added SolrEventListener for firstSearcher: org.apache.solr.core.QuerySenderListener{queries=[{q=solr rocks,start=0,
Nov 06, 2012 11:43:23 AM org.apache.solr.request.XSLTResponseWriter <init>
WARNING: org.apache.solr.request.XSLTResponseWriter is deprecated. Please use the corresponding class in org.apache.solr.res
Nov 06, 2012 11:43:23 AM org.apache.solr.response.XSLTResponseWriter init
INFO: xsltCacheLifetimeSeconds=5
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created standard: solr.SearchHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created dismax: solr.SearchHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created partitioned: solr.SearchHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /spell: solr.SearchHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created tvrh: org.apache.solr.handler.component.SearchHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: adding lazy requestHandler: org.apache.solr.handler.extraction.ExtractingRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /update/extract: org.apache.solr.handler.extraction.ExtractingRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /terms: org.apache.solr.handler.component.SearchHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: adding lazy requestHandler: solr.SearchHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /elevate: solr.SearchHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /update: solr.XmlUpdateRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /update/javabin: solr.BinaryUpdateRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /analysis/document: solr.DocumentAnalysisRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /analysis/field: solr.FieldAnalysisRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: adding lazy requestHandler: solr.CSVRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /update/csv: solr.CSVRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /admin/: org.apache.solr.handler.admin.AdminHandlers
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /admin/ping: PingRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /debug/dump: solr.DumpRequestHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /mlt: solr.MoreLikeThisHandler
Nov 06, 2012 11:43:23 AM org.apache.solr.search.SolrIndexSearcher <init>
INFO: Opening Searcher@11a1bb4 main
Nov 06, 2012 11:43:23 AM org.apache.solr.update.CommitTracker <init>
INFO: commitTracker AutoCommit: disabled
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SpellCheckComponent inform
INFO: Initializing spell checkers
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SpellCheckComponent inform
WARNING: No queryConverter defined, using default converter
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.QueryElevationComponent inform
INFO: Loading QueryElevation from: C:\Users\Ger\Documents\web_dev\connectedtrips\ruby-postgres\ruby\1.9.1\bundler\gems\sunsp
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@51d871
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@158e4ee
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@11dd242
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@d6f8f6
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@17300c2
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@136d8e4
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@51d871
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@158e4ee
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@11dd242
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@d6f8f6
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@17300c2
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@136d8e4
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@51d871
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@158e4ee
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@11dd242
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@d6f8f6
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@17300c2
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@136d8e4
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@51d871
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@158e4ee
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@11dd242
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@d6f8f6
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@17300c2
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.SpellCheckComponent@1d974d9
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@136d8e4
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@51d871
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@158e4ee
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@11dd242
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@d6f8f6
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@17300c2
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.TermVectorComponent@1865381
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@136d8e4
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.TermsComponent@1d4714d
Nov 06, 2012 11:43:23 AM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener sending requests to Searcher@11a1bb4 main
Nov 06, 2012 11:43:23 AM org.apache.solr.core.CoreContainer register
INFO: registering core:
Nov 06, 2012 11:43:23 AM org.apache.solr.servlet.SolrDispatchFilter init
INFO: user.dir=C:\Users\Ger\Documents\web_dev\connectedtrips\ruby-postgres\ruby\1.9.1\bundler\gems\sunspot-f8d901958835\suns
Nov 06, 2012 11:43:23 AM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init() done
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=null path=null params={start=0&event=firstSearcher&q=solr+rocks&rows=10} hits=0 status=0 QTime=46
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=null path=null params={event=firstSearcher&q=static+firstSearcher+warming+query+from+solrconfig.xml} hits=0
Nov 06, 2012 11:43:23 AM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener done.
Nov 06, 2012 11:43:23 AM org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener newSearcher
INFO: Loading spell index for spellchecker: default
Nov 06, 2012 11:43:23 AM org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init()
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: solr home defaulted to 'solr/' (could not find system property or JNDI)
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrCore registerSearcher
INFO: [] Registered new searcher Searcher@11a1bb4 main
Nov 06, 2012 11:43:23 AM org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init() done
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Nov 06, 2012 11:43:23 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: solr home defaulted to 'solr/' (could not find system property or JNDI)
Nov 06, 2012 11:43:23 AM org.apache.solr.servlet.SolrUpdateServlet init
INFO: SolrUpdateServlet.init() done
2012-11-06 11:43:23.930:INFO::Started SocketConnector@0.0.0.0:8983

我不太确定这里出了什么问题。我确信我已经正确设置了我的应用程序。谁能向我解释这里出了什么问题并可能帮助我?谢谢

编辑:这可能不是 Windows 的特定错误。现在发生在我的 Mac 上,当我的一个邮件程序试图发送邮件时发生错误。我正在使用 resque 和 redis 来运行后台作业。

最佳答案

你能单独点击 solr url 看看它是否有效。它不起作用,然后检查 solr 日志以查看错误的实际原因。

关于ruby-on-rails - Errno::ECONNREFUSED 由于目标机器主动拒绝,无法建立连接。 - 在 Rails 应用程序中使用 connect(2) 进行 Mongodb 搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13248555/

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