getaddrinfo:solr sunspot 未知名称或服务

发布于 2024-12-14 03:31:08 字数 1299 浏览 2 评论 0原文

我正在尝试使用 Rails 3.1 运行 solr 和 sunspot,但我不断收到错误消息,

getaddrinfo: Name or service not known

我的控制器相当基本

  def index
        @food_names = FoodName.search do 
            keywords(params[:term])
        end
  end

,我仍然不太确定这里发生了什么。我必须启动单独的 solr 服务吗?

当我运行 rake sunspot:solr:run 时,我得到了一个

WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /home/pete/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Kitchon::Application#task called at /home/pete/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.0/lib/rails/application.rb:214:in `initialize_tasks'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /home/pete/.rvm/gems/ruby-1.9.2-p290/gems/sunspot_rails-1.2.0/lib/sunspot/rails/tasks.rb:41:in `block in '
rake aborted!
Server is already running with PID 4012

Tasks: TOP => sunspot:solr:start
(See full trace by running task with --trace)

有点令人不安的信息,但正如输出所示,服务器已经在运行,所以我认为它正在工作。

关于我可能做错了什么或者如何解决这个问题有什么建议吗?

I'm attempting to run solr and sunspot with rails 3.1, but I keep getting the error

getaddrinfo: Name or service not known

my controller is fairly basic

  def index
        @food_names = FoodName.search do 
            keywords(params[:term])
        end
  end

I'm still not quite sure about what is going on here. do I have to start a separate solr service?

When I run rake sunspot:solr:run, I get a

WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /home/pete/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: Global access to Rake DSL methods is deprecated.  Please include
    ...  Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Kitchon::Application#task called at /home/pete/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.0/lib/rails/application.rb:214:in `initialize_tasks'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /home/pete/.rvm/gems/ruby-1.9.2-p290/gems/sunspot_rails-1.2.0/lib/sunspot/rails/tasks.rb:41:in `block in '
rake aborted!
Server is already running with PID 4012

Tasks: TOP => sunspot:solr:start
(See full trace by running task with --trace)

which is a bit disconcerting, but as the output says, the server is already running, so I think it is working.

Any suggestions on what I may be doing wrong, or how to fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文