您好我最近获得了一个使用sunspot
的Rails 3.2.0项目我遇到了以下错误:
RSolr::Error::Http - 404 Not Found
Error: Not Found
URI: http://localhost:8982/solr/select?wt=ruby
Request Headers: {"Content-Type"=>"application/x-www-form-urlencoded; charset=UTF-8"}
Request Data: "fq=type%3APost&fq=-kind_s%3A%28event+OR+contest+OR+job+OR+review%29&fq=-category_im%3A%28%29&fq=exclude_from_explore_b%3Afalse&fq=-destroyed_at_d%3A%5B*+TO+*%5D&fq=published_at_ds%3A%5B*+TO+2016%5C-04%5C-26T12%5C%3A07%5C%3A29Z%5D&fq=published_at_ds%3A%5B*+TO+*%5D&fq=verified_author_b%3Atrue&sort=published_at_ds+desc&start=0&rows=24&q=*%3A*"
Backtrace: /home/revrun/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.13/lib/rsolr/client.rb:284:in `adapt_response'
/home/revrun/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.13/lib/rsolr/client.rb:190:in `execute'
/home/revrun/.rvm/gems/ruby-2.1.2/gems/rsolr-1.0.13/lib/rsolr/client.rb:176:in `send_and_receive'
(eval):2:in `post'
/home/revrun/.rvm/gems/ruby-2.1.2/gems/sunspot-1.3.3/lib/sunspot/search/abstract_search.rb:38:in `execute'
/home/revrun/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-1.3.3/lib/sunspot/rails/searchable.rb:329:in `solr_execute_search'
/home/revrun/.rvm/gems/ruby-2.1.2/gems/sunspot_rails-1.3.3/lib/sunspot/rails/searchable.rb:153:in `solr_search'
/home/revrun/Code/saf/safarious/app/controllers/explore/posts_controller.rb:76:in `post_search'
/home/revrun/Code/saf/safarious/app/controllers/explore/posts_controller.rb:15:in `category'
/home/revrun/.rvm/gems/ruby-2.1.2/gems/actionpack-3.2.13/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/home/revrun/.rvm/gems/ruby-2.1.2/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:167:in `process_action'
我安装的宝石如下:
*** LOCAL GEMS ***
actionmailer (4.2.6, 4.1.0, 3.2.13)
actionpack (4.2.6, 4.1.0, 3.2.13)
actionview (4.2.6, 4.1.0)
activejob (4.2.6)
activemodel (4.2.6, 4.1.0, 3.2.13)
activerecord (4.2.6, 4.1.0, 3.2.13)
activeresource (3.2.13)
activesupport (4.2.6, 4.1.0, 3.2.13)
acts-as-taggable-on (2.3.3)
acts_as_votable (0.8.0)
addressable (2.4.0, 2.3.6, 2.3.2)
afm (0.2.0)
annotate (2.5.0)
arel (6.0.3, 5.0.1.20140414130214, 3.0.2)
Ascii85 (1.0.2)
authlogic (3.2.0)
autoprefixer-rails (6.3.6)
awesome_print (1.6.1, 1.1.0)
base58 (0.1.0)
bcrypt (3.1.7)
bcrypt-ruby (3.0.1)
bigdecimal (1.2.4)
binding_of_caller (0.7.2)
bootstrap (4.0.0.alpha3)
bootstrap-sass (3.1.1.1, 3.1.1.0)
bourbon (3.0.1)
braintree (2.22.0)
browser (0.1.6)
bson (3.2.6)
builder (3.2.2, 3.0.4)
bundler (1.8.3)
bundler-unload (1.0.2)
byebug (8.2.2)
callsite (0.0.11)
cancan (1.6.10)
capistrano (3.2.1)
capistrano-bundler (1.1.2)
capistrano-rails (1.1.1)
capistrano-rvm (0.1.1)
capybara (2.3.0, 2.0.2)
carmen (0.2.13)
carrierwave (0.8.0)
carrierwave_backgrounder (0.1.3)
childprocess (0.5.3, 0.3.6)
chronic (0.10.2)
client_side_validations (3.2.1)
client_side_validations-simple_form (2.0.1)
coderay (1.1.1)
coffee-rails (4.1.1, 4.0.0, 3.2.2)
coffee-script (2.4.1, 2.3.0)
coffee-script-source (1.10.0, 1.8.0)
colorize (0.7.3)
commonjs (0.2.7)
concurrent-ruby (1.0.1)
connection_pool (2.2.0)
cookiejar (0.3.0)
crack (0.4.2, 0.3.2)
daemons (1.2.3, 1.1.9)
dante-editor (0.0.14)
database_cleaner (1.3.0, 0.9.1)
debug_inspector (0.0.2)
declarative_authorization (0.5.7)
delayed_job (4.1.1, 3.0.4)
delayed_job_active_record (0.3.3)
delayed_job_mongoid (2.2.0)
diff-lcs (1.2.5, 1.1.3)
domain_name (0.5.20160309)
dotenv (0.9.0)
dotenv-rails (0.9.0)
em-http-request (1.1.3)
em-socksify (0.3.1)
email_validator (1.4.0)
erubis (2.7.0)
eventmachine (1.2.0.1, 1.0.3)
exceptional (2.0.33)
excon (0.49.0, 0.16.10)
execjs (2.6.0, 2.2.1, 1.4.0)
executable-hooks (1.3.2)
factory_girl (4.4.0, 4.1.0)
factory_girl_rails (4.4.1, 4.1.0)
fakeredis (0.4.1)
faraday (0.9.2, 0.9.0, 0.8.11, 0.7.6)
faraday_middleware (0.10.0, 0.9.0)
fattr (2.2.1)
faye (1.1.2)
faye-websocket (0.10.3)
ffi (1.9.3, 1.3.1)
filepicker-rails (0.1)
fog (1.9.0)
foreman (0.78.0)
formatador (0.2.4)
garb (0.9.1)
gem-wrappers (1.2.7)
globalid (0.3.6)
god (0.13.7)
haml (4.0.7)
haml-rails (0.9.0)
handlebars_assets (0.19.1)
hashdiff (0.3.0)
hashery (2.1.0)
hashie (3.4.3, 1.2.0)
heroku (3.43.0)
heroku-api (0.4.2)
highline (1.7.8, 1.6.15)
hike (1.2.3, 1.2.2)
hiredis (0.4.5)
html2haml (2.0.0)
htmlentities (4.3.1)
http-cookie (1.0.2)
http_parser.rb (0.6.0)
httpauth (0.2.0)
i18n (0.7.0, 0.6.11, 0.6.1)
io-console (0.4.2)
jbuilder (2.4.1, 1.5.3)
journey (1.0.4)
jquery-rails (4.1.1, 3.1.0, 2.2.0)
jquery-ui-rails (4.2.1)
json (1.8.3, 1.8.1, 1.8.0)
jwt (1.5.1, 1.0.0)
launchy (2.4.3, 2.1.2)
less (2.6.0)
less-rails (2.7.1)
letter_opener (1.0.0)
libv8 (3.16.14.13 x86-linux)
linkedin (0.3.7)
lograge (0.2.0)
loofah (2.0.3)
mail (2.6.3, 2.5.4, 2.5.3)
mail_view (1.0.3)
medium-editor-rails (2.2.0)
meta_request (0.2.5)
method_source (0.8.2)
mime-types (2.99.1, 1.25.1, 1.21)
mini_magick (3.4)
mini_portile (0.6.0)
mini_portile2 (2.0.0)
minitest (5.8.4, 5.3.5, 4.7.5)
mongo (2.1.2)
mongoid (5.1.1)
mongoid-compatibility (0.3.1)
mono_logger (1.1.0)
multi_json (1.11.2, 1.10.1, 1.7.3)
multi_xml (0.5.5)
multipart-post (2.0.0, 1.2.0, 1.1.5)
nesty (1.0.2)
net-scp (1.2.1, 1.0.4)
net-ssh (2.9.2, 2.9.1, 2.6.3)
net-ssh-gateway (1.2.0)
netrc (0.11.0, 0.10.3)
newrelic_rpm (3.6.4.122)
nokogiri (1.6.7.2, 1.6.2.1, 1.5.5)
oauth (0.5.1, 0.4.7)
oauth2 (1.1.0, 0.9.4, 0.6.1)
omniauth (1.3.1, 1.1.1)
omniauth-facebook (3.0.0, 1.4.0)
omniauth-linkedin (0.0.8)
omniauth-oauth (1.0.1)
omniauth-oauth2 (1.4.0, 1.0.2)
omniauth-twitter (0.0.14)
optionable (0.2.0)
options (2.3.2, 2.3.0)
origin (2.2.0)
panda (1.6.0)
pdf-inspector (1.1.0)
pdf-reader (1.3.2)
pg (0.17.1)
polyglot (0.3.5, 0.3.3)
pr_geohash (1.0.0)
prawn (0.12.0)
prawn-qrcode (0.2.0)
prawn_rails (0.0.11)
progress_bar (1.0.5, 0.4.0)
pry (0.10.3)
pry-byebug (3.3.0)
psych (2.0.5)
public_activity (1.5.0)
quiet_assets (1.1.0, 1.0.2)
rack (1.6.4, 1.5.2, 1.4.7, 1.4.5)
rack-cache (1.2)
rack-contrib (1.1.0)
rack-protection (1.5.3)
rack-ssl (1.3.3)
rack-test (0.6.3, 0.6.2)
rails (4.2.6, 4.1.0, 3.2.13)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.7)
rails-html-sanitizer (1.0.3)
rails-sanitize-js (1.0.0)
rails_autolink (1.1.0)
rails_config (0.4.2)
railties (4.2.6, 4.1.0, 3.2.13)
rake (11.1.1, 10.3.2, 10.1.0, 10.0.4)
rdoc (4.1.2, 4.1.0, 3.12.2)
recaptcha (0.3.5)
redis (3.2.2, 3.1.0, 3.0.4)
redis-actionpack (3.2.3)
redis-activesupport (3.2.3)
redis-namespace (1.5.1)
redis-rack (1.4.2)
redis-rails (3.2.3)
redis-store (1.1.4)
ref (2.0.0)
resque (1.25.2)
rest-client (1.8.0, 1.6.9, 1.6.8)
rest-client-components (1.4.0)
rqrcode (0.4.2)
rsolr (1.1.1, 1.0.13, 1.0.10)
rspec-core (2.14.8, 2.12.2)
rspec-expectations (2.14.5, 2.12.1)
rspec-mocks (2.14.6, 2.12.1)
rspec-rails (2.14.0, 2.12.2)
ruby-hmac (0.4.0)
ruby-oembed (0.8.8)
ruby-prof (0.12.1)
ruby-rc4 (0.1.5)
ruby_parser (3.8.1)
rubygems-bundler (1.4.4)
rubyzip (1.1.7, 1.1.6, 0.9.9)
rvm (1.11.3.9)
safe_yaml (1.0.3)
sass (3.4.22, 3.4.21, 3.2.19, 3.2.5)
sass-rails (5.0.4, 4.0.2, 3.2.6)
sdoc (0.4.1)
selenium-webdriver (2.42.0, 2.29.0)
sequel (3.20.0)
sexp_processor (4.7.0)
simple_form (2.0.4)
sinatra (1.4.5, 1.0)
sitemap_generator (4.0.1)
slop (3.6.0)
sorcery (0.8.6)
spring (1.6.4)
sprockets (3.5.2, 2.11.0, 2.2.2)
sprockets-rails (3.0.4, 2.0.1)
sqlite3 (1.3.9)
sshkit (1.5.1)
state_machine (1.1.2)
subexec (0.2.2)
sunspot (1.3.3)
sunspot_rails (1.3.3)
sunspot_solr (2.2.5)
taps (0.3.24)
test-unit (2.1.2.0)
test_after_commit (0.2.0)
therubyracer (0.12.2)
thin (1.6.4, 1.5.1)
thor (0.19.1, 0.18.1)
thread_safe (0.3.5, 0.3.4)
tilt (2.0.2, 1.4.1)
treetop (1.4.15, 1.4.12)
ttfunk (1.0.3)
turbolinks (2.2.3)
typhoeus (0.2.4)
tzinfo (1.2.2, 0.3.37)
uglifier (2.7.2, 1.3.0)
underscore-rails (1.8.3)
unf (0.1.4)
unf_ext (0.0.7.2)
vegas (0.1.11)
web-console (2.3.0)
webmock (1.18.0)
websocket (1.0.7, 1.0.6)
websocket-driver (0.6.3)
websocket-extensions (0.1.2)
whenever (0.9.4)
will_paginate (3.0.4)
xpath (2.0.0, 1.0.0)
yaml_db (0.2.3)
我的sunspot.yml:
production:
solr:
hostname: localhost
port: 8983
log_level: WARNING
development:
solr:
hostname: localhost
port: 8982
log_level: INFO
test:
solr:
hostname: localhost
port: 8981
log_level: WARNING
我在SO上尝试过很多其他建议,但似乎没有什么可以解决这个问题。我没有太阳黑子的经验,所以深受欢迎的答案:-D
感谢。
答案 0 :(得分:1)
答案 1 :(得分:0)
您应该在sunspot.yml文件中提供path
:
development:
solr:
hostname: localhost
port: 8982
log_level: INFO
path: /solr/your_collection
请注意,path
在Solr的请求中使用如下:
http://localhost:8982/solr/#/your_collection
此外,如果您使用预定义的Solr,则应通过rake任务启动它:
bundle exec rake sunspot:solr:start
答案 2 :(得分:0)
刚遇到同样的问题。在我的情况下,有一个陈旧的太阳黑子过程运行。我做的是: