heroku 运行控制台返回“连接到进程时出错" [英] heroku run console returns 'Error connecting to process'

查看:21
本文介绍了heroku 运行控制台返回“连接到进程时出错"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将 rails 3.1 应用程序部署到 Heroku Cedar 堆栈,并且正在尝试执行:

I have deployed a rails 3.1 app to Heroku Cedar stack, and am trying to perform a:

heroku run rake db:migrate

它返回:

Running console attached to terminal... 
Error connecting to process

我也尝试简单地启动控制台:

I also try to simply launch the console:

heroku run console

任何运行命令都会返回相同的错误.

Any run command returns the same error.

Running console attached to terminal... 
Error connecting to process

查看日志我得到错误代码:

Looking at the logs I get the error code:

2011-09-25T16:04:52+00:00 app[run.2]: Error R13 (Attach error) -> Failed to attach to process

当我 heroku ps 查看当前进程时,我可以看到我的尝试正在运行:

When I heroku ps to see the current processes, I can see my attempts are running:

Process       State               Command
------------  ------------------  ------------------------------
run.2         complete for 26m    bundle exec rails console
run.3         up for 27s          bundle exec rails console
run.4         up for 3s           bundle exec rake db:create
web.1         up for 46s          bundle exec thin start -p $PORT -e..

但同样,他们每个人都提出了例外:

But again each of them are raising exceptions:

2011-09-25T16:31:47+00:00 app[run.3]: Error R13 (Attach error) -> Failed to attach to process
2011-09-25T16:31:47+00:00 heroku[run.3]: Process exited
2011-09-25T16:31:48+00:00 heroku[run.3]: State changed from up to complete
2011-09-25T16:32:11+00:00 app[run.4]: Error R13 (Attach error) -> Failed to attach to process
2011-09-25T16:32:11+00:00 heroku[run.4]: Process exited
2011-09-25T16:32:12+00:00 heroku[run.4]: State changed from up to complete

服务器管理员不是我的菜,因此决定使用 Heroku.

Server Admin isnt my cup of tea, hence the decision to use Heroku.

Heroku 文档和谷歌搜索都没有让我走上一条让我继续前进的道路.

Both Heroku docs and Googling have not led me down a path that give me much to go on.

有什么想法吗?这不是我在 Bamboo 堆栈上的经验.

Any ideas? This has not been my experience on the Bamboo stack.

我的其他错误显然与未执行数据库迁移有关.在我可以运行 rake 任务之前,我一直在前进.

My other errors are obviously related to DB migrations not being performed. Until I can run the rake tasks, I'm stuck moving forward.

推荐答案

我也遇到了同样的问题,虽然我没有解决问题,但我找到了解决方法.

I had the same problem, and although I did not solve the problem, I found a workaround.

而不是使用:

heroku 运行 rake db:migrate

heroku run rake db:migrate

您可以使用:

heroku 运行:分离 rake db:迁移

heroku run:detached rake db:migrate

这会在后台运行命令,将输出写入日志.完成后,您可以查看结果日志.

This runs the command in the background, writing the output to the log. When it is finished you can view the log for the result.

不理想,但是当您使用的网络不足时,它会让您摆脱困境:)

Not ideal, but when you are on an inadequate network, it will get you out of a hole :)

这篇关于heroku 运行控制台返回“连接到进程时出错"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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