Sunspot 未在开发端口上启动

发布于 2024-12-11 05:25:33 字数 866 浏览 0 评论 0原文

我正在尝试在开发端口(8982)上运行 sunspot。 我运行以下命令 $ RAILS_ENV=development rake sunspot:solr:start

Sunspot 启动,但它不在开发端口上启动,而是在端口 8983 上启动,这是生产端口。 我没有使用 config/sunspot.yml。我有一个 config/initializers/sunspot.rb 文件,其内容如下

require File.join(Rails.root, 'lib', 'sunspot', 'rails', 'adapters')
Sunspot::Adapters::InstanceAdapter.register(Sunspot::Rails::Adapters::ActiveRecordInstanceAdapter, ActiveRecord::Base)
Sunspot::Adapters::DataAccessor.register(Sunspot::Rails::Adapters::ActiveRecordDataAccessor, ActiveRecord::Base)

module Sunspot
  HIGHLIGHTS = {
    :elements => ['span'], :attributes => { 'span' => ['class'] }
  }

另外在 config/environments/development.rb 中,我有一行内容为“

Sunspot.config.solr.url = 'http://localhost:8982/solr'

我不确定我做错了什么”。我需要在端口 8982(开发节点)上启动 sunspot。

任何帮助将不胜感激

I am trying to run sunspot on the development port (8982).
I run the following command
$ RAILS_ENV=development rake sunspot:solr:start

Sunspot starts but it does not start on the development port, it starts on port 8983, which is the production port.
I am not using config/sunspot.yml. I have a config/initializers/sunspot.rb file which reads as follows

require File.join(Rails.root, 'lib', 'sunspot', 'rails', 'adapters')
Sunspot::Adapters::InstanceAdapter.register(Sunspot::Rails::Adapters::ActiveRecordInstanceAdapter, ActiveRecord::Base)
Sunspot::Adapters::DataAccessor.register(Sunspot::Rails::Adapters::ActiveRecordDataAccessor, ActiveRecord::Base)

module Sunspot
  HIGHLIGHTS = {
    :elements => ['span'], :attributes => { 'span' => ['class'] }
  }

Additionally in config/environments/development.rb I have a line that reads

Sunspot.config.solr.url = 'http://localhost:8982/solr'

I am not sure what I am doing wrong. I need to start sunspot on Port 8982 ( the development node).

Any help would be appreciated

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

随心而道 2024-12-18 05:25:33

请参阅 https://github.com/sunspot/sunspot/issues/262 来跟踪错误的解决方案。

See https://github.com/sunspot/sunspot/issues/262 to track the resolution of the bug.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文