假设您已经使用home-brew安装和升级Postgres,您可以执行以下步骤。
>停止当前Postgres服务器:@H_404_2@
launchctl unload〜/ Library / LaunchAgents / homebrew.mxcl.postgresql.plist
>初始化一个新的9.5数据库:@H_404_2@
initdb /usr/local/var/postgres9.5 -E utf8
>运行pg_upgrade:@H_404_2@
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/
>将新数据移动到位:@H_404_2@
cd /usr/local/var mv postgres postgres9.4 mv postgres9.5 postgres
>重新启动Postgres:@H_404_2@
launchctl load〜/ Library / LaunchAgents / homebrew.mxcl.postgresql.plist
>检查/usr/local/var/postgres/server.log以获取详细信息,并确保新服务器正常启动。
>最后,重新安装rails pg gem@H_404_2@
gem uninstall pg gem install pg
我建议你花一些时间阅读PostgreSQL documentation,以确切地了解你在上述步骤中做什么,以减少沮丧。@H_404_2@