我正试图用Thinking Sphinx实现一个简单的搜索,但它不起作用。我正在经历“
A Quick Guide to Getting Setup with Thinking Sphinx
”,当我尝试使用
rake ts:index
我犯了一个严重的错误:
Generating configuration to /Users/Kuba/Desktop/Rails/black/config/development.sphinx.conf
Sphinx 2.0.6-release (r3473)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/Users/Kuba/Desktop/Rails/black/config/development.sphinx.conf'...
indexing index 'news_post_core'...
ERROR: index 'news_post_core': sql_connect: Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2) (DSN=mysql://root:***@localhost:3306/black1).
total 0 docs, 0 bytes
total 0.005 sec, 0 bytes/sec, 0.00 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
我不知道该怎么办。我唯一的索引是:
ThinkingSphinx::Index.define :news_post, :with => :active_record do
indexes title
end
我的database.yml是:
development:
adapter: mysql2
encoding: utf8
database: black1
pool: 5
username: root
password:
test:
adapter: mysql2
encoding: utf8
database: black1
pool: 5
username: root
password:
production:
adapter: mysql2
encoding: utf8
database: black1
pool: 5
username: root
password:
我从Oracle网站下载的软件包中安装了MySQL。
我使用的系统是Mountain Lion。我肯定有MySQL服务器在运行,很容易检查系统首选项。
此外,我通过Macports安装了狮身人面像。
对此有什么可能的解决方案?