Thinking Sphinx で簡単な検索を実装しようとしていますが、うまくいきません。「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 の Web サイトからダウンロードしたパッケージから MySQL をインストールしました。
私が使用しているシステムは Mountain Lion です。私は間違いなくMySQLサーバーを実行しています。システム設定を簡単に確認できます。
また、Macports から Sphinx をインストールしました。これに対する可能な解決策は何ですか?