Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails PG::ConnectionBad无法连接到服务器-heroku本地rails应用程序_Ruby On Rails_Heroku Postgres - Fatal编程技术网

Ruby on rails PG::ConnectionBad无法连接到服务器-heroku本地rails应用程序

Ruby on rails PG::ConnectionBad无法连接到服务器-heroku本地rails应用程序,ruby-on-rails,heroku-postgres,Ruby On Rails,Heroku Postgres,我试着运行heroku local或heroku local web,一切正常。将数据从heroku remote导入本地环境后,它开始向我抛出以下错误: 在某些地方搜索解决方案后,我尝试使用brew services restart postgresql重新启动postgresql服务,它正常启动,但我一直收到错误消息。我还尝试按照这篇SO帖子的建议删除postmaster.pid,但没有找到文件。嗯,找到解决方案比我想象的要容易 在同一篇文章()中,它建议在删除文件之前检查日志,我甚至没有

我试着运行heroku local或heroku local web,一切正常。将数据从heroku remote导入本地环境后,它开始向我抛出以下错误:


在某些地方搜索解决方案后,我尝试使用
brew services restart postgresql
重新启动postgresql服务,它正常启动,但我一直收到错误消息。我还尝试按照这篇SO帖子的建议删除
postmaster.pid
,但没有找到文件。

嗯,找到解决方案比我想象的要容易

在同一篇文章()中,它建议在删除文件之前检查日志,我甚至没有找到要删除的文件

当我查看日志时,我发现了以下内容:

因此,我检查了heroku的Postgres版本,它默认使用12,但
brew
使用最新版本,即13

总而言之,我从Postgre v12转储到Postgre v13,这是不兼容的,所以我将降级我的本地Postgre,以便按预期处理我的数据

为此,我做了以下工作:

brew卸载postgres
-删除v13

brew安装postgresql@12
-安装特定版本

brew服务启动postgresql@12
-启动新版本

事实上,我不需要恢复或修改数据,因为即使卸载Postgresql,数据也没有被删除