--
---
You received this message because you are subscribed to the Google Groups "Case Commons Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to casecommons-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
== AddUnaccentExtension: reverting ===========================================
-- execute("drop extension unaccent")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedObject: ERROR: extension "unaccent" does not exist
: drop extension unaccent/Users/robertjewell/.rvm/gems/ruby-2.0.0-p353/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec'
.......
Tasks: TOP => db:rollback
(See full trace by running task with --trace)
Here is the full stack trace. If I have installed postresql with homebrew and have implemented the above migration to implement the unaccent search functionality, then why am I running into this error when I write, :ignoring => :accents
class AddPgStatStatementsExtension < ActiveRecord::Migration def up execute 'CREATE EXTENSION IF NOT EXISTS pg_stat_statements' end def down execute 'DROP EXTENSION pg_stat_statements' end end
ran rake:db:migrate
PG::UndefinedFunction: ERROR: function unaccent(text) does not exist
LINE 1: ...LECT "users".*, ((ts_rank((to_tsvector('english', unaccent(c...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Here's the error in terminal. As I mentioned before, I installed postgresql with homebrew and from what I've read online that is all that is required. Then again, it appears that this, PG::UndefinedFunction: ERROR: function unaccent(text) does not exist, is the core problem, and I do not know how to rectify it. I've read this post by Grant, but I am not using ubuntu. Should I follow the advice that Grant adds at the end with regards to pg_search_dmetaphone?
postgresql 9.3.0 9.3.4
$ brew info postgresql
postgresql: stable 9.3.4 (bottled), devel 9.4beta1
http://www.postgresql.org/
Conflicts with: postgres-xc
/usr/local/Cellar/postgresql/9.3.0 (2913 files, 40M)
Built from source
/usr/local/Cellar/postgresql/9.3.4 (2921 files, 38M) *
Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/postgresql.rb
==> Dependencies
Required: openssl ✔, readline ✔
Recommended: ossp-uuid ✔
$ brew update
Updated Homebrew from bdd9d8cc to 953a945b.
==> New Formulae
storm
==> Updated Formulae
davix ejabberd freeimage ghc ledger orientdb plt-racket premake scala ume
docker elasticsearch gcc git-annex mess passenger postgresql riak simple-tiles xmount
Should I switch postresql to the older version, 9.3.0 ?
Roberts-MacBook-Pro:local robertjewell$ postgres --version
postgres (PostgreSQL) 9.3.1
$ which postgres
/Applications/Postgres93.app/Contents/MacOS/bin/postgres
Roberts-MacBook-Pro:local robertjewell$ psql -d grassroots_development
psql (9.3.1, server 9.3.4)
Type "help" for help.
grassroots_development=# \dx
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(1 row)
grassroots_development=#
$ which postgres
/usr/local/bin/postgres
$ postgres --
version
postgres (PostgreSQL) 9.3.5
$ psql -d grassroots_development
psql (9.3.5)
Type "help" for help.
grassroots_development=# \dx
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(1 row)
grassroots_development=#
Despite running the migration file, I still do not have the unaccent function:
class AddUnaccentExtension < ActiveRecord::Migration
def
up
execute 'CREATE EXTENSION IF NOT EXISTS unaccent'
end
def down
execute 'DROP EXTENSION unaccent'
end
end
grassroots_development=# CREATE EXTENSION unaccent;
CREATE EXTENSION
grassroots_development=# \dx
List of installed extensions
Name | Version | Schema | Description
----------+---------+------------+---------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
unaccent | 1.0 | public | text search dictionary that removes accents
(2 rows)
The gem is working with the following options, :ignoring => :accents,
I could not be happier. You have an awesome week, sir.
...