0

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...
0bserver07
  • 3,390
  • 1
  • 28
  • 56

1 Answers1

1

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

zwippie
  • 15,050
  • 3
  • 39
  • 54
  • Holy $code! I realized that was the problem on my Mac, here is how to fix it, maybe add it to your answer: https://github.com/Casecommons/pg_search/wiki/Installing-Postgres-Contrib-Modules – 0bserver07 Sep 23 '14 at 22:30