当前位置: 首页 > 知识库问答 >
问题:

brew更新升级后如何修复postgres

咸昊昊
2023-03-14

我升级到了mavericks,在安装/编译新的gems时遇到了一些麻烦,所以我重新安装了xcode,并进行了brew更新和升级。Gems现在可以工作了,甚至postgres也继续工作了一段时间,直到最近重新启动。现在波斯特格雷斯似乎有问题。

postgres:

postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.


brew info postgres:

postgresql: stable 9.3.2 (bottled)
http://www.postgresql.org/
Conflicts with: postgres-xc
/usr/local/Cellar/postgresql/9.2.4 (2842 files, 39M)
  Built from source
/usr/local/Cellar/postgresql/9.3.2 (2924 files, 39M) *
  Poured from bottle

postgres -D /usr/local/var/postgres:

FATAL:  database files are incompatible with server
DETAIL:  The data directory was initialized by PostgreSQL version 9.2, which is not compatible with this version 9.3.2.

共有1个答案

方寒
2023-03-14
$ brew tap homebrew/versions
$ brew install postgresql92
$ brew switch postgresql 9.2.8 # might need to check this one, could be newer by the time you read this
$ pg_dumpall > ninedottwo-dump
$ brew uninstall postgresql92
$ brew switch postgresql 9.3.4 # again, check version
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
$ createdb # i got an error about my database not existing, so i had to run this
$ psql < ninedottwo-dump
$ bundle exec rails s

感谢彼得让我开始了正确的方向。

编辑:这会教我一次升级所有的东西...

 类似资料:
  • 最近对OSX Mavericks的升级中断了我的Rails应用程序的数据库连接。 当我尝试从数据库中提取时,服务器返回以下错误: 当尝试运行时,我得到: 我已经尝试了许多在互联网上可用的解决方案。例如重新安装pg gem并在my database.yml中设置host:localhost。我的/usr/local/var/postgres/pg_hba.conf文件显示: 返回哪个psql: 这件

  • Kubernetes到目前为止基本保持三个月发行一个新版本的节奏,更新节奏可以说非常快,这一部分将主要跟踪kubernetes及其相关组件的更新与升级。

  • 使用pip更新包的方法是什么?那些不工作: 我知道这是一个简单的问题,但它是需要的,因为它不是那么容易找到(pip留档不弹出和其他问题从堆栈溢出相关,但不完全是关于)

  • 问题内容: 在更新OSx并安装我的环境的新版本后,我彻底无法解决它。我不确定是什么原因导致的,并列出了我所做的并且最初阅读 无效的 一整套内容。答案部分提供了解决我的问题的方法。 无法修复未找到的命令的原因: 通过自制软件安装python,然后使用pip安装virtualenv 通过https://www.python.org安装python ,然后使用pip安装virtualenv 相关问题对我

  • 在OSx更新并安装了新版本的python 2.7之后,我的环境完全崩溃了,我很难修复它。我不确定是什么原因造成的,我经历了一整套我做过的事情,最初读到的那些不起作用的东西列在下面。答案部分提供了解决问题的方法。 通过家酿安装python,然后用pip安装viralenv 通过https://www.python.org安装了python,然后用pip安装虚拟环境 帮助了我,但没有解决我的问题的相关

  • 问题内容: 使用pip更新软件包的方式是什么?那些不起作用: 我知道这是一个简单的问题,但由于不是那么容易找到它,所以它是必需的(pip文档不会弹出,并且堆栈溢出中的其他问题是相关的,但并不完全与此相关) 问题答案: 方式是 或总之 使用会要求输入您的root密码来确认操作,但是尽管很常见,但被认为是不安全的。 如果您没有root密码(如果您不是管理员),则可能应该使用virtualenv。 您也