我将 /opt/local
(Macports 的东西所在)中的所有内容都移到了 ~/.macports
中。其中包括我的旧 postgres 数据库集群。
然后我使用 Homebrew 安装了 postgres 并运行了它告诉我的设置(在 /usr/local
中创建一个新的数据库集群)。
在我的项目中,我运行了 rake db:drop:all
和 rake db:create
。他们愉快地完成了自己的工作。
但是当我尝试rake db:migrate
时,postgres 和rails 争执并告诉我
rake aborted!
PGError: ERROR: unrecognized time zone name: "UTC"
: SET time zone 'UTC'
不过我不知道他们在说什么。我发现this article关于 config.time_zone
bug 稍微有启发性,但不足以找到我的方法。
谢谢!
最佳答案
我收到此错误,只需手动启动 postgres:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
您也可以停止它:
pg_ctl -D /usr/local/var/postgres stop -s -m fast
关于postgresql - 从 Macports 切换到 Homebrew 后,Rails 和 Postgres 相处得并不好; PG错误: ERROR: unrecognized time zone name: "UTC",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4154774/