Giter Site home page Giter Site logo

Comments (16)

KurtPreston avatar KurtPreston commented on July 22, 2024

On that note, the README does not tell you that you must add any lines to the Rakefile. Without these instructions, the step rake 'sunspot:solr:start will not run.

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

Tasks should be loaded automatically. What happens if you remove those require lines from your Rakefile?

from sunspot.

KurtPreston avatar KurtPreston commented on July 22, 2024

If I remove the require lines, no sunspot tasks are listed when I do a rake -T.

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

What if you keep the require lines but use rake sunspot:reindex instead of sunspot:solr:reindex?

from sunspot.

KurtPreston avatar KurtPreston commented on July 22, 2024

If I have no require lines:

  • No sunspot rake tasks show.

With just require 'sunspot/solr/tasks':

  • No reindexing tasks are available

With just require 'sunspot/rails/tasks':

  • rake sunspot:solr:start returns "Note: This task has been moved to the sunspot_solr gem"

With both require 'sunspot/solr/tasks' and require 'sunspot/rails/tasks':

  • Same. rake sunspot:solr:start returns "Note: This task has been moved to the sunspot_solr gem"

from sunspot.

KurtPreston avatar KurtPreston commented on July 22, 2024

Of note, I can get it working by modifying sunspot_rails-1.3.0/lib/sunspot/rails/tasks.rb:59.

The line says unless defined?(Sunspot::Solr), then proceeds to define stubs for the Sunspot:Solr rake tasks. When I change it to unless false, then the code works fine.

It seems than sunspot_rails is not accurately detecting the presence of the sunspot_solr gem.

from sunspot.

KurtPreston avatar KurtPreston commented on July 22, 2024

Apparently, this problem started with sunspot_rails 1.3.0. It works fine under sunspot_rails 1.2.1.

from sunspot.

nielsjansendk avatar nielsjansendk commented on July 22, 2024

+1 I have the samme problem rails 2.3.12, sunspot 1.3.0. Version 1.2.1 works.

from sunspot.

nz avatar nz commented on July 22, 2024

It seems than sunspot_rails is not accurately detecting the presence of the sunspot_solr gem.

Load order issues here perhaps? Hm.

@KurtPreston @ninajansen β€”Β can you show us [the relevant parts of] your app's Gemfile?

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

I've been meaning to setup a Rails 2.3.14 application and try out the rake tasks. Might be able to get to it soon.

from sunspot.

KurtPreston avatar KurtPreston commented on July 22, 2024

There's nothing particularly fancy about our Gemfile. For the time, we've downgraded to sunspot_rails 1.2.0. But anyway, when we tried 1.3.0, our Gemfile looked like:


source :rubygems

gem 'rails', '2.3.14'
...
gem 'sunspot_rails', '1.3.0'

group :development do
  ...
  gem "sunspot_solr", "1.3.0"
end

from sunspot.

KurtPreston avatar KurtPreston commented on July 22, 2024

Any update on this issue?

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

I can reproduce it, but do not yet know how to fix it. Patches welcomed.

from sunspot.

nathany avatar nathany commented on July 22, 2024

Same issue on a Rails 2.3.14 app using Bundler 1.1.rc.7. Tried rearranging the gems (solr first) but makes no difference.

Search

gem 'sunspot', '> 1.3.0'
gem 'sunspot_rails', '
> 1.3.0'
gem 'sunspot_solr', '~> 1.3.0'

As above, commenting out require 'sunspot/rails/tasks' got the start & stop commands working, but lost the reindex command.

from sunspot.

alindeman avatar alindeman commented on July 22, 2024

I merged in a fix to both 1-3-stable and master that claims to have fixed this. Can someone here try it out? Thanks.

from sunspot.

xiewenwei avatar xiewenwei commented on July 22, 2024

I resolved this by modifying the Rakefile.

My env is : sunspot_rails 1.3.1 sunspot_solr 1.3.1 Rails 2.3.11.

Add

module Sunspot
module Solr
end
end

above require 'sunspot/solr/tasks' require 'sunspot/rails/tasks' in the Rakefile

from sunspot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.