3

升級Postgres後,我收到以下錯誤,當我嘗試遷移數據庫。PG :: UndefinedFile:錯誤:無法打開擴展控制文件

enable_extension(:postgis) 
    SQL (17.2ms) CREATE EXTENSION IF NOT EXISTS "postgis" 
PG::UndefinedFile: ERROR: could not open extension control file "/usr/local/Cellar/postgresql/9.4.5/share/postgresql/extension/postgis.control": No such file or directory 
: CREATE EXTENSION IF NOT EXISTS "postgis" 
    (0.3ms) ROLLBACK 
rake aborted! 
StandardError: An error has occurred, this and all later migrations canceled: 

PG::UndefinedFile: ERROR: could not open extension control file "/usr/local/Cellar/postgresql/9.4.5/share/postgresql/extension/postgis.control": No such file or directory 
: CREATE EXTENSION IF NOT EXISTS "postgis"/Users/harshamv/Sites/clink/db/migrate/20150812164615_enable_postgis.rb:3:in `change' 
-e:1:in `<main>' 
ActiveRecord::StatementInvalid: PG::UndefinedFile: ERROR: could not open extension control file "/usr/local/Cellar/postgresql/9.4.5/share/postgresql/extension/postgis.control": No such file or directory 
: CREATE EXTENSION IF NOT EXISTS "postgis" 
/Users/harshamv/Sites/clink/db/migrate/20150812164615_enable_postgis.rb:3:in `change' 
-e:1:in `<main>' 
PG::UndefinedFile: ERROR: could not open extension control file "/usr/local/Cellar/postgresql/9.4.5/share/postgresql/extension/postgis.control": No such file or directory 
/Users/harshamv/Sites/clink/db/migrate/20150812164615_enable_postgis.rb:3:in `change' 
-e:1:in `<main>' 
Tasks: TOP => db:migrate 
(See full trace by running task with --trace) 

不確定從哪裏開始。大多數其他問題似乎與Linux相關,當我嘗試創建符號鏈接時,它也無法工作。

+0

您是否嘗試過'brew install postgis'? – max

+1

看起來像PostGIS需要重新安裝,是的。出於某種原因,Homebrew似乎會安裝到包含次要版本(如/9.4.5/)的目錄中,這會在每次較小的更新時破壞內容。 –

回答

2

您應該安裝postgresql-9.4-postgis-2.1

+0

只需將[it](https://github.com/Casecommons/pg_search/issues/38)放在這裏。 – Netsu

相關問題