2

I am using rails 2.3.4 and sphinx 1.4.4 and raspell 1.0.0. Now I would like to add fuzzy match in sphinx search, so I added in my config/environment.rb file I added the following lines:

config = ThinkingSphinx::Configuration.instance

config.raspell.dictionary             = 'en'

config.raspell.suggestion_mode        = :badspellers

Ref - https://github.com/freelancing-god/thinking-sphinx-raspell

while starting my server it throws the error like this

 undefined method `raspell' for 
 #<ThinkingSphinx::Configuration:0xb63d7f8c> (NoMethodError)

Can you help me on this?

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
Rafiu
  • 4,700
  • 6
  • 25
  • 27

2 Answers2

0

What happens if you shift that configuration to an initialiser? And do you have it currently at the top or the bottom of config/environment.rb? It should be at the bottom, outside of Rails' own configuration block (gems aren't loaded until the block is processed).

pat
  • 16,116
  • 5
  • 40
  • 46
  • Thanks for your reply.. I shift that configuration to initializer. Then run the same it produces the same error... – Rafiu Feb 01 '12 at 08:59
0

This is the problem because of the gem versions. I modified gem versions this issue is fixed now.

Here the Gems and its versions:

Thinking sphinx - 1.3.17

Active Record - 2.3.5

After Commit - 1.0.10

Riddle - 1.0.10

Thinking sphinx Raspell - 1.1.1

Raspell -1.3

Rafiu
  • 4,700
  • 6
  • 25
  • 27