当我在Heroku中访问我的应用程序并检查资源时,我可以看到Postgresql
但是当我从我的计算机运行pg:info时,得到以下内容:
$ heroku pg:info !找不到资源或者这个:
$ heroku pg:等待!找不到资源虽然当我运行pg:凭证时,我得到一个输出:
$ heroku pg:凭证HEROKU_POSTGRESQL_PINK 连接信息字符串:dbname = some_name host = ec2-107-22-165 -15pute-1.amazonaws port = 5432 user = some_user password = some_password sslmode = require<我已经尝试运行 heroku运行rake db:migrate , heroku run db:reset 并且全部失败。 我得到错误:
无法连接到服务器:连接被拒绝服务器是否正在运行主机localhost并接受端口5432上的 TCP / IP连接?通过heroku网站进行设置,我可以看到以下内容:
连接设置:默认 主人ec2-107-22-165-15pute-1.amazonaws 数据库some_databasename 用户some_user 端口5432 密码some_password 统计数据计划开发可用状态数据大小5.9 MB 表格0 PG版本9.1.8 创建于2013年3月27日18:01heroku config 已设置DATABASE_URL和HEROKU_POSTGRESQL_PINK_URL。
$ c>生产部分 database.yml 据我了解Heroku创建它自己的 database.yml $ c $
我刚刚迁移到ruby 2.0和rails 4.0
我应该如何连接到数据库?我认为这应该是自动的。谢谢
解决方案通过降级Rails和Ruby解决了这个问题:( p <现在我使用rails 3.1.0和ruby 1.9.3
When I go to my Apps in Heroku and check the resources I can see Postgresql
but when I run from my computer pg:info I get the following:
$ heroku pg:info ! Resource not foundor this:
$ heroku pg:wait ! Resource not foundalthough when I run pg:credential I do get an output:
$ heroku pg:credentials HEROKU_POSTGRESQL_PINK Connection info string: "dbname=some_name host=ec2-107-22-165-15pute-1.amazonaws port=5432 user=some_user password=some_password sslmode=require"I have tried running heroku run rake db:migrate, heroku run db:reset and all fail. I get the errors:
could not connect to server: Connection refused Is the server running on host "localhost" and accepting TCP/IP connections on port 5432?Going to the settings through the heroku web, I can see the following:
Connection Settings : Default Host ec2-107-22-165-15pute-1.amazonaws Database some_databasename User some_user Port 5432 Password some_password Statistics Plan Dev Status available Data Size 5.9 MB Tables 0 PG Version 9.1.8 Created March 27, 2013 18:01heroku config has DATABASE_URL and HEROKU_POSTGRESQL_PINK_URL set.
I have erased the production section of database.yml as I understand Heroku creates its own database.yml
I just migrated to ruby 2.0 and rails 4.0
how should I connect to the database? I thought this was supposed to be automatic. Thanks
解决方案Solved this by downgrading Rails and Ruby :(
Now I'm using rails 3.1.0 and ruby 1.9.3
更多推荐
Heroku postgres未找到
发布评论