PG::ConnectionBad: 运行导出 DATABASE_URL=postgres://$(whoami) 后无法翻译主机名错误

2024-01-12

我运行后收到此错误

export DATABASE_URL=postgres://$(whoami)

在命令行上。现在当我运行命令时

$$ rake db:migrate

这是完整的错误

rake aborted!
PG::ConnectionBad: could not translate host name "Jillian" to address: nodename nor servname provided, or not known

Tasks: TOP => db:migrate

如何修复 postgres?

PS我正在关注这个教程https://devcenter.heroku.com/articles/heroku-postgresql#local-setup https://devcenter.heroku.com/articles/heroku-postgresql#local-setup为 python 应用程序设置 pg,但我可能有旧版本的 pg。我试图至少让 postgres 恢复到运行之前的状态^


....以及你们一直在等待的答案:

如果您通过运行导出弄乱了您的开发环境DATABASE_URL=...,如果您遇到与上述情况类似的情况并且已经在每个项目中设置了环境,请通过运行来解决此问题

unset DATABASE_URL
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

PG::ConnectionBad: 运行导出 DATABASE_URL=postgres://$(whoami) 后无法翻译主机名错误 的相关文章

随机推荐