产生错误:
nil:NilClass 的未定义方法“注入”
尽管在: https ://github.com/pat/thinking-sphinx/issues/408#issuecomment-12593562 进行了讨论, 但似乎我确实为基于 postgre 的应用程序正确安装了 mySQL 和 sphinx
MacBook-Pro-di-jerdvo:saim jerdvo$ brew install sphinx --mysql
错误:sphinx-2.0.3 已经安装
MacBook-Pro-di-jerdvo:saim jerdvo$ brew install mysql
错误:mysql-5.5.20 已经安装
gemfile 包括
宝石'rails','3.2.13'
宝石'pg','0.14.1'
宝石'mysql2','0.3.12b5'
宝石'thinking-sphinx','3.0.3'
正在捕获搜索参数
{"utf8"=>"✓", "staticpage_search"=>{"terms"=>"Messina"}}
搜索模型正在运行代码
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