ruby on rails - rake sunspot:solr:start throwing an error -


i'm trying use sunspot rails 4 , i'm running issue. when have gem 'sunspot_rails', '2.0.0' in gemfile error:

note: task has been moved sunspot_solr gem. install, start ,   stop local solr instance, please add sunspot_solr gemfile:   group :development     gem 'sunspot_solr'  end 

but when add gem(also v 2.0.0) error:

rake aborted! don't know how build task 'sunspot:solr:start' /home/toasty/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval' /home/toasty/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>' (see full trace running task --trace) 

i have seen question: sunspot/solr raketasks not loading in rails 3 mountable engine doesn't seem work in case. have ideas? sunspot_solr not compatible rails 4?

i had same problem. don't recall found rake task need add

lib/tasks/solr.rake  namespace :sunspot   namespace :solr   desc 'start solr instance'     task :start => :environment       case ruby_platform         when /w(in)?32$/, /java$/           abort("this command not supported on #{ruby_platform}. " +           "use rake sunspot:solr:run run solr in foreground.")      end    if defined?(sunspot::rails::server)     sunspot::rails::server.new.start   else     sunspot::solr::server.new.start   end   puts "successfully started solr ..." end  desc 'run solr instance in foreground' task :run => :environment   if defined?(sunspot::rails::server)     sunspot::rails::server.new.run   else     sunspot::solr::server.new.run   end end  desc 'stop solr instance' task :stop => :environment   case ruby_platform   when /w(in)?32$/, /java$/     abort("this command not supported on #{ruby_platform}. " +           "use rake sunspot:solr:run run solr in foreground.")   end    if defined?(sunspot::rails::server)     sunspot::rails::server.new.stop   else     sunspot::solr::server.new.stop   end   puts "successfully stopped solr ..." end  # backwards compatibility task :reindex => :"sunspot:reindex" end end 

edit~ source of rakefile


Comments