ruby-on-railssolrruby-on-rails-5sunspot-railssunspot-solr

Rails - Sunspot solr is not starting in development


While I am executing following command, after bundle solr related gems

bundle exec rake sunspot:solr:start

I got permission error:

Creating directory /apps/test_app/current/solr
rake aborted!
Errno::EACCES: Permission denied @ dir_s_mkdir - /apps
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/sunspot_solr-2.2.6/lib/sunspot/solr/installer.rb:48:in `block in execute'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/sunspot_solr-2.2.6/lib/sunspot/solr/installer.rb:37:in `each'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/sunspot_solr-2.2.6/lib/sunspot/solr/installer.rb:37:in `execute'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/sunspot_solr-2.2.6/lib/sunspot/solr/installer.rb:17:in `execute'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/sunspot_solr-2.2.6/lib/sunspot/solr/server.rb:174:in `install_solr_home'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/sunspot_solr-2.2.6/lib/sunspot/solr/server.rb:40:in `bootstrap'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/sunspot_solr-2.2.6/lib/sunspot/solr/server.rb:55:in `start'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/sunspot_solr-2.2.6/lib/sunspot/solr/tasks.rb:10:in `block (3 levels) in <top (required)>'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/bin/ruby_executable_hooks:15:in `eval'
/home/rp/.rvm/gems/ruby-2.3.1@test_app/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => sunspot:solr:start
(See full trace by running task with --trace)

It would be great help if anyone had idea regarding this. Thanks in advance!


Solution

  • sunspot configuration should be this config/sunspot.yml

    development:
      solr:
        hostname: localhost
        port: 8982
        log_level: INFO
    
    test:
      solr:
        hostname: localhost
        port: 8981
        log_level: WARNING
    

    Ref: github repo