【发布时间】:2013-12-10 17:40:45
【问题描述】:
当我尝试在我的 localhost:3000 上运行我的示例 Rails 4.0.1 应用程序时,我收到此错误:
PG:: ConnectionsBad 致命:角色“myapp”不存在。
我在 Maverick OSX 上运行并使用 Ruby 2.0。我完全按照https://devcenter.heroku.com/articles/getting-started-with-rails4 的指示创建了我的示例应用程序,但是当我尝试 '$ rails server' 时,我得到了上面的错误。我正在运行当前的 Postgres。我试图根据其他 stackoverflow 建议更改 pg_hba.conf,但到目前为止它仍然无法正常工作。我可以使用 MySQL3 在本地主机上运行,但不能使用 Postgresql。我想按照 Heroku 的建议在开发、测试和生产中运行 Postgresql。
参考: Rails: Deploying to Heroku, Many Problems, Repairing postgresql after upgrade to OSX Mavericks
【问题讨论】:
-
你的
database.yml是什么样的? -
ps auxwww | grep postgres的输出是什么 -
这是我的 database.yml... 开发:适配器:postgresql 编码:unicode 数据库:AAA_website_heroku_development 池:5 用户名:AAA_website_heroku 密码:测试:适配器:postgresql 编码:unicode 数据库:AAA_website_heroku_test 池:5用户名:AAA_website_heroku 密码:生产:适配器:postgresql 编码:unicode 数据库:AAA_website_heroku_production 池:5 用户名:AAA_website_heroku 密码:
-
你创建了数据库吗?
标签: ruby heroku ruby-on-rails-4 rails-postgresql heroku-postgres