33

Very lost as I haven't made any changes to my search which has always been working but somehow I've got a break. Being relatively new to Rails, the error output isn't giving me enough detail to debug.

Relevant code below - ask if you want to see anything else.

home.html.slim (excerpt with search form)

= form_tag search_venues_path, method: :get, id: 'search' do |f|
  .search-fields.span16
    p = text_field_tag :q, '', placeholder: "Search for coffee, hotel, etc", class: 'span7 search-field'
    p = text_field_tag :zip, '', placeholder: "Zip code or city name", class: 'span4 search-field'
    p = submit_tag "Find it", class: "btn-main span4"
    br
    = hidden_field_tag :latitude, ''
    = hidden_field_tag :longitude, ''
    p.current_location.hidden.offset1
      a Use my current location

VenuesController.rb (excerpt with search function)

def search
  if params[:zip].blank? && params[:latitude].blank?
    flash[:notice] = 'You must include a location to search.'
    return redirect_to(root_path)
  end

  @venues = VenueSearch.search(params)
  #@json = Venue.all.to_gmaps4rails
end

VenueSearch.rb

def self.search(params)
  if params[:zip].present?
    logger.info "The zip code is present"
    logger.debug(Geocoder.coordinates(params[:zip]))
    lat, long = Geocoder.coordinates(params[:zip])
  else
    lat = params[:latitude]
    long = params[:longitude]
  end

  fake_distance = 20 * 0.6214 # 1.5 miles

  Venue.search(include: [:venue_category, :venue_subcategory]) do
    fulltext params[:q].gsub(/[^\s\w]/, ''), minimum_match: 2 do
      boost_fields name: 5.0, name_without_punc: 5.0, category: 3.5, subcategory: 3.5, tags: 4.0
    end

    paginate page: params[:page]
    order_by_geodist :location, lat, long
    with(:location).in_radius(lat, long, fake_distance)
  end
end

Error, Full Trace

rsolr (1.0.9) lib/rsolr/client.rb:268:in `adapt_response'
rsolr (1.0.9) lib/rsolr/client.rb:175:in `execute'
rsolr (1.0.9) lib/rsolr/client.rb:161:in `send_and_receive'
sunspot_rails (2.1.0) lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
activesupport (3.2.2) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.2) lib/active_support/notifications.rb:123:in `instrument'
sunspot_rails (2.1.0) lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
sunspot (2.1.0) lib/sunspot/search/abstract_search.rb:45:in `execute'
sunspot_rails (2.1.0) lib/sunspot/rails/searchable.rb:344:in `solr_execute_search'
sunspot_rails (2.1.0) lib/sunspot/rails/searchable.rb:158:in `solr_search'
app/models/venue_search.rb:14:in `search'
app/controllers/venues_controller.rb:12:in `search'
actionpack (3.2.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.2) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.2) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.2) lib/active_support/callbacks.rb:426:in `block in _run__2118553356002381387__process_action__2728035982816219113__callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_941'
activesupport (3.2.2) lib/active_support/callbacks.rb:326:in `around'
activesupport (3.2.2) lib/active_support/callbacks.rb:310:in `_callback_around_13'
activesupport (3.2.2) lib/active_support/callbacks.rb:214:in `_conditional_callback_around_941'
activesupport (3.2.2) lib/active_support/callbacks.rb:414:in `_run__2118553356002381387__process_action__2728035982816219113__callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.2) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.2) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.2) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.2) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.2) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.2) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.2) lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
activerecord (3.2.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.2) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.2) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.2) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.2) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.2) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:67:in `call'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:67:in `dispatch'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:30:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.2) lib/action_dispatch/routing/route_set.rb:594:in `call'
omniauth (1.1.4) lib/omniauth/strategy.rb:184:in `call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.2) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.2) lib/active_support/callbacks.rb:405:in `_run__1412551976247017377__call__2752945716229395531__callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.2) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
airbrake (3.1.14) lib/airbrake/rails/middleware.rb:13:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.2) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.2) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.2) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.2) lib/action_dispatch/middleware/static.rb:61:in `call'
airbrake (3.1.14) lib/airbrake/user_informer.rb:16:in `_call'
airbrake (3.1.14) lib/airbrake/user_informer.rb:12:in `call'
railties (3.2.2) lib/rails/engine.rb:479:in `call'
railties (3.2.2) lib/rails/application.rb:220:in `call'
railties (3.2.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
rack (1.4.5) lib/rack/deflater.rb:13:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.2) lib/rails/rack/log_tailer.rb:14:in `call'
thin (1.6.1) lib/thin/connection.rb:82:in `block in pre_process'
thin (1.6.1) lib/thin/connection.rb:80:in `catch'
thin (1.6.1) lib/thin/connection.rb:80:in `pre_process'
thin (1.6.1) lib/thin/connection.rb:55:in `process'
thin (1.6.1) lib/thin/connection.rb:41:in `receive_data'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
thin (1.6.1) lib/thin/backends/base.rb:73:in `start'
thin (1.6.1) lib/thin/server.rb:162:in `start'
rack (1.4.5) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.5) lib/rack/server.rb:268:in `start'
railties (3.2.2) lib/rails/commands/server.rb:70:in `start'
railties (3.2.2) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.2) lib/rails/commands.rb:50:in `tap'
railties (3.2.2) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'

Request Params

 {"utf8"=>"✓",
 "q"=>"grill",
 "zip"=>"94107",
 "commit"=>"Find it",
 "latitude"=>"",
 "longitude"=>""}

Sunspot.yml

development:
  solr:
    hostname: localhost
    port: 8983
    log_level: INFO
    path: /solr/development

sunspot-solr-development.log

Nov 3, 2013 10:15:34 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
Nov 3, 2013 10:15:34 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Nov 3, 2013 10:15:34 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: using system property solr.solr.home: /Users/justin.raczak/Desktop/Desktop-Content/crowdscore/solr
Nov 3, 2013 10:15:34 PM org.apache.solr.core.CoreContainer$Initializer initialize
INFO: looking for solr.xml: /Users/justin.raczak/Desktop/Desktop-Content/crowdscore/solr/solr.xml
Nov 3, 2013 10:15:34 PM org.apache.solr.core.CoreContainer <init>
INFO: New CoreContainer 1884473012
Nov 3, 2013 10:15:34 PM org.apache.solr.core.CoreContainer$Initializer initialize
INFO: no solr.xml file found - using default
Nov 3, 2013 10:15:34 PM org.apache.solr.core.CoreContainer load
INFO: Loading CoreContainer using Solr Home: '/Users/justin.raczak/Desktop/Desktop-Content/crowdscore/solr/'
Nov 3, 2013 10:15:34 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: new SolrResourceLoader for directory: '/Users/justin.raczak/Desktop/Desktop-Content/crowdscore/solr/'
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting socketTimeout to: 0
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting urlScheme to: http://
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting connTimeout to: 0
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting maxConnectionsPerHost to: 20
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting corePoolSize to: 0
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting maximumPoolSize to: 2147483647
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting maxThreadIdleTime to: 5
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting sizeOfQueue to: -1
Nov 3, 2013 10:15:34 PM org.apache.solr.handler.component.HttpShardHandlerFactory getParameter
INFO: Setting fairnessPolicy to: false
Nov 3, 2013 10:15:34 PM org.apache.solr.client.solrj.impl.HttpClientUtil createClient
INFO: Creating new http client, config:maxConnectionsPerHost=20&maxConnections=10000&socketTimeout=0&connTimeout=0&retry=false
Nov 3, 2013 10:15:35 PM org.apache.solr.core.CoreContainer load
INFO: Registering Log Listener
Nov 3, 2013 10:15:35 PM org.apache.solr.core.CoreContainer create
INFO: Creating SolrCore 'collection1' using instanceDir: /Users/justin.raczak/Desktop/Desktop-Content/crowdscore/solr/collection1
Nov 3, 2013 10:15:35 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: new SolrResourceLoader for directory: '/Users/justin.raczak/Desktop/Desktop-Content/crowdscore/solr/collection1/'
Nov 3, 2013 10:15:35 PM org.apache.solr.core.CoreContainer recordAndThrow
SEVERE: Unable to create core: collection1
org.apache.solr.common.SolrException: Could not load config for solrconfig.xml
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:991)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1051)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:634)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/Users/justin.raczak/Desktop/Desktop-Content/crowdscore/solr/collection1/conf/', cwd=/Users/justin.raczak/.rvm/gems/ruby-1.9.3-p385/gems/sunspot_solr-2.1.0/solr
at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:318)
at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:283)
at org.apache.solr.core.Config.<init>(Config.java:103)
at org.apache.solr.core.Config.<init>(Config.java:73)
at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:117)
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:989)
... 11 more
Nov 3, 2013 10:15:35 PM org.apache.solr.common.SolrException log
SEVERE: null:org.apache.solr.common.SolrException: Unable to create core: collection1
at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:1672)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1057)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:634)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.apache.solr.common.SolrException: Could not load config for solrconfig.xml
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:991)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1051)
... 10 more
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/Users/justin.raczak/Desktop/Desktop-Content/crowdscore/solr/collection1/conf/', cwd=/Users/justin.raczak/.rvm/gems/ruby-1.9.3-p385/gems/sunspot_solr-2.1.0/solr
at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:318)
at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:283)
at org.apache.solr.core.Config.<init>(Config.java:103)
at org.apache.solr.core.Config.<init>(Config.java:73)
at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:117)
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:989)
... 11 more

Nov 3, 2013 10:15:35 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: user.dir=/Users/justin.raczak/.rvm/gems/ruby-1.9.3-p385/gems/sunspot_solr-2.1.0/solr
Nov 3, 2013 10:15:35 PM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init() done
Nov 3, 2013 10:15:39 PM org.apache.solr.servlet.SolrDispatchFilter handleAdminRequest
INFO: [admin] webapp=null path=/admin/cores params={indexInfo=false&wt=json} status=0 QTime=37 
Nov 3, 2013 10:36:58 PM org.apache.solr.servlet.SolrDispatchFilter handleAdminRequest
INFO: [admin] webapp=null path=/admin/cores params={indexInfo=false&wt=json} status=0 QTime=1 
justinraczak
  • 776
  • 2
  • 9
  • 24
  • 1
    What's the Solr end-point that you've pointed to? Is that up and running? – Srikanth Venugopalan Nov 04 '13 at 00:51
  • @SrikanthVenugopalan I've added my sunspot.yml to the bottom of the question. Is that what you're referring to? Apologies if not, I'm really green with Solr. – justinraczak Nov 04 '13 at 01:01
  • great.. I assume you are able to hit `http://localhost:8983` from the server where you get this error? – Srikanth Venugopalan Nov 04 '13 at 06:06
  • @SrikanthVenugopalan - I was previously able to get to the admin here: http://localhost:8983/solr/#/development - but I updated my solr gems to 2.1.0 and now get the following error: http://screencast.com/t/rtXpIBbRisPq . Any ideas? – justinraczak Nov 04 '13 at 06:32
  • 1
    Hmm - tells me that your Solr instance isnt up, due to error in SolrConfig. Can you look at your Solr (Jetty) logs? It should have a stack trace – Srikanth Venugopalan Nov 04 '13 at 06:55
  • @SrikanthVenugopalan I've added my sunspot-solr-development.log from the /log directory to the bottom of the question above. – justinraczak Nov 04 '13 at 18:51

7 Answers7

58

I came across the same issue when upgrading to sunspot 2.1.0 from 2.0.0.

I resolved this by adding following line to sunspot.yml (under config in my rails app) on the development: block (maybe one is needed for test and production )

    solr_home: solr

So my SOLR installation is under rails-app-dir/solr and the configuration there under conf.

Marko Taponen
  • 1,676
  • 1
  • 13
  • 3
  • 4
    At this moment in time, you are my hero. That fixed the 404 error on my dev environment! I'm going to push to staging shortly to test the same addition in that environment. Thank you so much. My search was actually broken before this also - for some reason the location search isn't working. If I post an SO entry about it, I wonder if you wouldn't mind taking a look for me? :) – justinraczak Nov 06 '13 at 21:09
  • Sadly, this doesn't fix it in production :( Any ideas on how to get that working? At this point I added the same fix you mentioned for development into the production block. Do you know of a specific reference that needs to be provided for production? – justinraczak Nov 06 '13 at 21:21
  • well - basically this needs to point whereever your SOLR files are. Use `locate` or `find` shell commands to figure that out. You are basically looking for data/production directory. One good candidate to look for `sunspot-solr-production.pid` – Marko Taponen Nov 07 '13 at 09:24
  • 1
    And just noticed something regarding the rails - sunspot datafiles. Seems that 2.1.0 stores data under the gems - directory. I think on 2.0.0 it was under rails app solr/ . – Marko Taponen Nov 07 '13 at 11:49
  • Do you know how to point solr_home to the gems directory? And would that go in the production block in the sunspot.yml? – justinraczak Nov 07 '13 at 18:47
  • this turned out to be an error on production because Websolr had deleted the index spontaneously. After creating a new index and pointing the WEBSOLR_URL config setting to it, the problem seems to be resolved on production/Heroku for the moment. – justinraczak Nov 08 '13 at 18:01
  • worked perfectly for me. For production, if you are using heroku, I think you have to use the solr add-on in order to utilize this. – nfriend21 Nov 24 '13 at 03:35
  • 1
    While this didn't exactly solve my problem, it gave me the idea that the migration from 2.0 to 2.1 was my issue. Rolled the Gem back to 2.0 and was able to get through my issue. Now I just need to figure out how to successfully migrate to 2.1. – Jay Shepherd Nov 26 '13 at 02:33
  • If I had a hat, I'd doff it to you. – Guillaume Roderick Sep 08 '16 at 14:26
38

These are the terminal commands you should follow to solve your problems:

  1. ps aux | grep solr to get solr process ID
  2. sudo kill <ID>, <ID> is the ID you found from 1
  3. rm -r <path/to/solr>, remove the solr directory inside your project to remove all of previous indexes
  4. RAILS_ENV=production bundle exec rake sunspot:solr:start
  5. Change the path to /solr/default inside config/sunspot.yml
    development:
      solr:
        hostname: localhost
        port: 8982
        log_level: INFO
        path: /solr/default
    
  6. RAILS_ENV=production bundle exec rake sunspot:solr:reindex

Bam! Problems solved! I hope.

Will Bryant
  • 313
  • 3
  • 7
vutran
  • 2,145
  • 21
  • 34
6

I've been looking forever for the answer to this issue, and to understand why the SOLR Admin page was crashing. Here's the solution for this problem when upgrading sunspot solr from 2.0.0 to 2.1.0:

Add this entry to your development section of the sunspot.yml: solr_home: solr like the follwoing example ...

development:
  solr:
    hostname: localhost
    port: 8982
    log_level: INFO
    path: /solr/development
    solr_home: solr
Ehud Pardo
  • 71
  • 1
3

Did someone check in the ./solr directory with your project?

If so, delete it, run rails g sunspot_rails:install and then start your server again.

This one's bit me twice now.

xdotcommer
  • 793
  • 1
  • 7
  • 14
2

@Marko Taponen's solution worked for me for a while, but now I'm back, because this problem reared its ugly head again, this time in my rpsec/capybara tests.

Here's what fixed it for me:

On the command line:

bundle exec rake sunspot:solr:stop

After doing this, I ran my tests again, and it worked.!

nfriend21
  • 2,170
  • 1
  • 21
  • 21
1
development:
  solr:
    hostname: localhost
    port: 8982
    log_level: INFO
    path: /solr
  auto_index_callback: after_commit
  auto_remove_callback: after_commit
fabro
  • 731
  • 6
  • 11
0

Also check if schema.xml is loaded from your gem file or from your solr directory in root of the app! You might end up changing schema.xml several times, but it would be the wrong file that is loaded.

Nesha Zoric
  • 6,218
  • 42
  • 34