Hello,

I've used TS a bit with Rails 2.3 and the experience was very smooth
-- thanks for all your hard work on this.

Currently I am exploring Sphinx/ThinkingSphinx as a replacement for
Ferret/acts_as_ferret on a Rails 2.0.2 application.  I've seen
elsewhere in this forum that TS *ought* to work with Rails 2.0.x, but
for me trying to build the indexes resulted in the following error:

> rake aborted!
> undefined method `configuration' for Rails:Module
> /opt/local/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.18/lib/thinking_sphinx/tasks.rb:7
> [...]

The offending line of code at tasks.rb:7 is:

        Rails.configuration.cache_classes = false

The method Rails#configuration was only introduced in 2.1, I believe,
so this call fails under Rails 2.0.x. I replaced the above line with
this:

        if defined?(Rails.configuration)
                Rails.configuration.cache_classes = false
        else
                Rails::Initializer.run do |config|
                        config.cache_classes = false
                end
        end

And that seemed to make indexing and searching work fine.

However, I wanted to see if this was an appropriate solution. I don't
know Rails or TS internals so well, so I want to be sure I'm not doing
something crazy here.

I'd appreciate any thoughts.

Thanks,
Roop

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to