>停止当前Postgres服务器:
launchctl unload〜/ Library / LaunchAgents / homebrew.mxcl.postgresql.plist
>初始化一个新的9.5数据库:
initdb /usr/local/var/postgres9.5 -E utf8
>运行pg_upgrade:
pg_upgrade -v \ -d /usr/local/var/postgres \ -D /usr/local/var/postgres9.5 \ -b /usr/local/Cellar/postgresql/9.4.5_2/bin/ \ -B /usr/local/Cellar/postgresql/9.5.0/bin/
>将新数据移动到位:
cd /usr/local/var mv postgres postgres9.4 mv postgres9.5 postgres
>重新启动Postgres:
launchctl load〜/ Library / LaunchAgents / homebrew.mxcl.postgresql.plist
>检查/usr/local/var/postgres/server.log以获取详细信息,并确保新服务器正常启动。
>最后,重新安装rails pg gem
gem uninstall pg gem install pg
我建议你花一些时间阅读PostgreSQL documentation,以确切地了解你在上述步骤中做什么,以减少沮丧。