Heroku postgres未找到

编程入门 行业动态 更新时间:2024-10-27 00:31:43
本文介绍了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 -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: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-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: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未找到

本文发布于:2023-10-16 05:16:54,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:未找到   Heroku   postgres

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!