2015-02-06 112 views
0

我尝试设置项目https://github.com/harrystech/prelaunchr。它失败了,因为我似乎有多个Postgres问题。在Yosemite上卸载Postgres并重新安装Postgres 9.3

我最近的问题是:

The data directory was initialized by PostgreSQL version 9.3, which is not compatible with this version 9.4.0. 

经过很多不同的方式,我想卸载Postgres的现在和设立的Postgres 9.3

我怎么能这样做?

谢谢 本杰明

更新:

我设法切换回PG 9.3。但是,当我尝试与启动服务器:

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start 

我得到:

LOG: could not open temporary-files directory "pg_tblspc/.keep/PG_9.3_201306121/pgsql_tmp": Not a directory 
LOG: could not open tablespace directory "pg_tblspc/.keep/PG_9.3_201306121": Not a directory 
LOG: database system was interrupted while in recovery at 2015-02-06 01:11:40 PST 
HINT: This probably means that some data is corrupted and you will have to use the last backup for recovery. 
LOG: database system was not properly shut down; automatic recovery in progress 
FATAL: could not open directory "pg_stat": No such file or directory 
LOG: startup process (PID 13187) exited with exit code 1 
LOG: aborting startup due to startup process failure 

回答

2

我希望这将帮助你:

mkdir -p /usr/local/var/postgres/{pg_tblspc,pg_twophase,pg_stat_tmp,pg_stat}/.keep 
-2

在你的开发环境,我建议你做简单/标准的东西。

更改config/database.yml文件以使用SQLITE。

default: &default 
    adapter: sqlite3 
    pool: 5 
    timeout: 5000 

development: 
    <<: *default 
    database: db/development.sqlite3 

而且您可能还需要更改您的Gemfile以包含sqlite。国际海事组织,在当地运行postgres是一个不必要的痛苦,除非你正在开发一些postgres特定的功能。这个程序没有,所以省去了麻烦。

相关问题