0bserver07
0bserver07

Reputation: 3471

Rails: Pg search, implementing dmetaphone with associated_against feature

after I created the :

rails g pg_search:migration:dmetaphone

I got this error:

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...

Upvotes: 0

Views: 878

Answers (1)

zwippie
zwippie

Reputation: 15515

It sounds like you forgot to install the postgresql-contrib package on your system.

Upvotes: 1

Related Questions