Heroku postgres未找到 [英] Heroku postgres not found

查看:203
本文介绍了Heroku postgres未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Heroku中访问我的应用程序并检查资源时,我可以看到Postgresql



但是当我从我的计算机运行pg:info时,得到以下内容:

  $ heroku pg:info 
!找不到资源

或者这个:

  $ heroku pg:等待
!找不到资源

虽然当我运行pg:凭证时,我得到一个输出:

  $ heroku pg:凭证HEROKU_POSTGRESQL_PINK 
连接信息字符串:
dbname = some_name host = ec2-107-22-165 -15.compute-1.amazonaws.com 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-15.compute-1.amazonaws.com
数据库some_databasename
用户some_user
端口5432
密码some_password

统计数据
计划开发
可用状态
数据大小5.9 MB
表格0
PG版本9.1.8
创建于2013年3月27日18:01

heroku config 已设置DATABASE_URL和HEROKU_POSTGRESQL_PINK_URL。



$ c>生产部分 database.yml 据我了解Heroku创建它自己的 database.yml

我刚刚迁移到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 found

or this:

$  heroku pg:wait 
!    Resource not found

although 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-15.compute-1.amazonaws.com 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-15.compute-1.amazonaws.com
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:01

heroku 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未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆