2011-07-04 36 views
18

我使用TS版本2.0.5,3.0.9導軌和mysql2 0.2.11思維獅身人面像未知類型'mysql';跳繩

當試圖創建我的索引,用耙TS:指數,我得到以下錯誤:

ERROR: source 'technical_core_0': unknown type 'mysql'; skipping. 

我development.sphinx.conf包含:

source technical_core_0 
{ 
    type = mysql 
    sql_host = localhost 
    sql_user = root 
    sql_pass = 
    sql_db = ps_development 
    sql_sock = /tmp/mysql.sock 
    sql_query_pre = SET NAMES utf8 
    sql_query_pre = SET TIME_ZONE = '+0:00' 
    sql_query = SELECT SQL_NO_CACHE `technicals`.`id` * CAST(1 AS SIGNED) + 0 AS `id` , `orders`.`name` AS `author`, `technicals`.`id` AS `sphinx_internal_id`, 0 AS `sphinx_deleted`, 488243725 AS `class_crc`, IFNULL(`orders`.`name`, '') AS `author_sort`, `technicals`.`order_id` AS `order_id`, UNIX_TIMESTAMP(`technicals`.`created_at`) AS `created_at`, UNIX_TIMESTAMP(`technicals`.`updated_at`) AS `updated_at` FROM `technicals` LEFT OUTER JOIN `orders` ON `orders`.`id` = `technicals`.`order_id` WHERE (`technicals`.`id` >= $start AND `technicals`.`id` <= $end) GROUP BY `technicals`.`id`, , `orders`.`name`, `technicals`.`id`, `orders`.`name`, `technicals`.`order_id`, `technicals`.`created_at`, `technicals`.`updated_at` ORDER BY NULL 
    sql_query_range = SELECT IFNULL(MIN(`id`), 1), IFNULL(MAX(`id`), 1) FROM `technicals` 
    sql_attr_uint = sphinx_internal_id 
    sql_attr_uint = sphinx_deleted 
    sql_attr_uint = class_crc 
    sql_attr_uint = order_id 
    sql_attr_timestamp = created_at 
    sql_attr_timestamp = updated_at 
    sql_attr_str2ordinal = author_sort 
    sql_query_info = SELECT * FROM `technicals` WHERE `id` = (($id - 0)/1) 
} 

我的database.yml文件包含mysql2和root密碼這是有點奇怪。

你能幫我渡過這個舞臺嗎?我也嘗試創建一個sphinx.yml文件:

development: 
adapter: mysql2 

但是這也失敗了。

- 更新 -

我加入到這個發展initialisers文件:

ThinkingSphinx.database_adapter = :mysql2 

它可以提供關於只有MySQL錯誤被支持。

回答

14

當您編譯獅身人面像時,您應該指定--with-mysql標誌。

$ ./configure --with-mysql 
$ make 
$ sudo make install 

您可能需要指定MySQL庫包含文件的位置。例如在全新安裝OS X的:

$ ./configure --with-mysql=/opt/local/include/mysql5 
+0

我會稍後再嘗試..謝謝 –

+0

嗨,這是在rails3上運行 - 它是不夠安裝寶石,幷包括在寶石文件? –

+2

不,思維獅身人面像是Sphinx搜索Ruby的接口,您需要在您的系統上安裝Sphinx。 – basicxman

2

生成的源代碼看起來正確 - 您的Sphinx版本是否可以在沒有MySQL支持的情況下編譯?

+0

喜八的工作,我剛安裝了寶石,可以在mysql中看到列出。也許我可以嘗試作爲插件安裝,但有點試圖避免。這很令人沮喪,現在... –

3

還通過自制軟件在OSX上安裝時,試試這個:

sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql 
brew install --interactive sphinx 
./configure 
make 
make install 
exit 
61

按照鏈接here,你可以簡單地做自制以下(MAC ):

brew install sphinx --with-mysql 

這對我來說:)

+0

你救了我的一天! – Darmen

+2

你總是可以'brew選項[包名]'這將給你所有可用的標誌。在這種情況下--mysql或--postgres –

+5

由於已經安裝了獅身人面像搜索,因此不得不's brew重新安裝sphinx --mysql'。 – RNickMcCandless

相關問題