2

나는 Rails 4와 함께 흑점을 사용하려고하는데 어떤 문제가있다. 나는이 질문을 보았다rake sunspot : solr : 오류 던져 시작

rake aborted! 
Don't know how to 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 by running task with --trace) 

:이 오류가

Note: This task has been moved to the sunspot_solr gem. To install, start and 
    stop a local Solr instance, please add sunspot_solr to your Gemfile: 
    group :development do 
    gem 'sunspot_solr' 
end 

하지만 그 보석을 추가 할 때 (또한 2.0.0을 V) : 내 gemfile 만 gem 'sunspot_rails', '2.0.0'있을 때 나는이 오류 : Sunspot/Solr raketasks not loading in Rails 3 Mountable Engine 하지만 내 경우에는 작동하지 않습니다. 누구든지 아이디어가 있습니까? sunspot_solr은 레일 4와 호환되지 않습니까?

+0

내가 가지고 그 오류를 추가해야이 레이크 작업을 찾을 발전에 sunspot_solr''와 일!하지만 참조 https://github.com/sunspot/sunspot/wiki/Configure-Solr-on-Ubuntu,--quickest-way – juanpastas

답변

12

동일한 문제가있었습니다. 나는 기억하지 않는다 그러나 나는`보석을 추가, 당신은

lib/tasks/solr.rake 

namespace :sunspot do 
    namespace :solr do 
    desc 'Start the Solr instance' 
    task :start => :environment do 
     case RUBY_PLATFORM 
     when /w(in)?32$/, /java$/ 
      abort("This command is not supported on #{RUBY_PLATFORM}. " + 
      "Use rake sunspot:solr:run to run Solr in the 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 the Solr instance in the foreground' 
task :run => :environment do 
    if defined?(Sunspot::Rails::Server) 
    Sunspot::Rails::Server.new.run 
    else 
    Sunspot::Solr::Server.new.run 
    end 
end 

desc 'Stop the Solr instance' 
task :stop => :environment do 
    case RUBY_PLATFORM 
    when /w(in)?32$/, /java$/ 
    abort("This command is not supported on #{RUBY_PLATFORM}. " + 
      "Use rake sunspot:solr:run to run Solr in the foreground.") 
    end 

    if defined?(Sunspot::Rails::Server) 
    Sunspot::Rails::Server.new.stop 
    else 
    Sunspot::Solr::Server.new.stop 
    end 
    puts "Successfully stopped Solr ..." 
end 

# for backwards compatibility 
task :reindex => :"sunspot:reindex" 
end 
end 

EDIT ~ Source of Rakefile