Generating error:
undefined method `inject' for nil:NilClass
Notwithstanding the discussion at: https://github.com/pat/thinking-sphinx/issues/408#issuecomment-12593562 it appears that I do have mySQL and sphinx properly installed for my postgre-based application
MacBook-Pro-di-jerdvo:saim jerdvo$ brew install sphinx --mysql
Error: sphinx-2.0.3 already installed
MacBook-Pro-di-jerdvo:saim jerdvo$ brew install mysql
Error: mysql-5.5.20 already installed
gemfile includes
gem 'rails', '3.2.13'
gem 'pg', '0.14.1'
gem 'mysql2', '0.3.12b5'
gem 'thinking-sphinx', '3.0.3'
search parameters are being captured
{"utf8"=>"✓", "staticpage_search"=>{"terms"=>"Messina"}}
search model is running code
def search(options = {})
extra_conditions = options.delete(:conditions) || {}
order = options.delete(:order) || '@weight DESC'
extra_with = options.delete(:with) || {}
with = search_with.merge(extra_with)
conditions = search_conditions.merge(extra_conditions)
base_class.search sanitized_terms, :conditions => conditions, :with => with, :page => page, :per_page => per_page, :sort_mode => :extended, :order => order, :retry_stale => true, :match_mode => :extended
end
def sanitized_terms
@terms ||= ""
sanitize(@terms)
end
def sanitize(s)
if s.respond_to? :gsub
s.gsub("/", "\\/")
else
s
end
end
Two things to note: