创建后:
rails g pg_search:migration:dmetaphone
我收到了这个错误:
Adding support functions for pg_search :dmetaphone
-- execute("CREATE OR REPLACE FUNCTION pg_search_dmetaphone(text) RETURNS text LANGUAGE SQL IMMUTABLE STRICT AS $function$\n SELECT array_to_string(ARRAY(SELECT dmetaphone(unnest(regexp_split_to_array($1, E'\\\\s+')))), ' ')\n$function$;\n")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedFunction: ERROR: function dmetaphone(text) does not exist
LINE 2: SELECT array_to_string(ARRAY(SELECT dmetaphone(unnest(rege...
答案 0 :(得分:1)
听起来您忘了在系统上安装postgresql-contrib
软件包。