Ruby on rails heroku运行控制台返回';连接到进程时出错';

Ruby on rails heroku运行控制台返回';连接到进程时出错';,ruby-on-rails,heroku,ruby-on-rails-3.1,rails-3.1,cedar,Ruby On Rails,Heroku,Ruby On Rails 3.1,Rails 3.1,Cedar,我已将rails 3.1应用程序部署到Heroku Cedar stack,并尝试执行以下操作: heroku run rake db:migrate 它返回: Running console attached to terminal... Error connecting to process 我还尝试简单地启动控制台: heroku run console 任何run命令都会返回相同的错误 Running console attached to terminal... Error

我已将rails 3.1应用程序部署到Heroku Cedar stack,并尝试执行以下操作:

heroku run rake db:migrate
它返回:

Running console attached to terminal... 
Error connecting to process
我还尝试简单地启动控制台:

heroku run console
任何run命令都会返回相同的错误

Running console attached to terminal... 
Error connecting to process
查看日志,我得到了错误代码:

2011-09-25T16:04:52+00:00 app[run.2]: Error R13 (Attach error) -> Failed to attach to process
当我查看当前进程时,我可以看到我的尝试正在运行:

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..
但它们都提出了例外情况:

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

Heroku docs和Google都没有引导我走上一条能让我继续前进的道路

有什么想法吗?这不是我在竹堆上的经历


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

Heroku似乎有问题-我在Cedar上运行的应用程序上连接到控制台时出错。您键入的命令肯定没有任何错误。

请尝试安装最新版本的heroku gem,然后再次运行这些“heroku run”命令。

此问题通常是由连接或防火墙问题引起的。您可以通过运行以下命令来测试与
heroku run
heroku console
服务器的连接:

$ telnet rendezvous.heroku.com 5000 
$ telnet s1.runtime.heroku.com 5000
(如果成功连接,请按Ctrl+],然后键入
quit
退出telnet会话。)

一些用户在其防火墙中将这些主机名+端口组合白名单后获得了成功

Heroku在一次性流程的故障排除部分提到了这一点:


需要很长时间启动的应用程序也会加剧连接问题。如果服务器响应不够快,您的本地连接将在应用程序启动前超时。

已解决-通过3G tether测试并收到响应,似乎不是防火墙;可能是代理服务器或ISP。

我也遇到了同样的问题,尽管我没有解决这个问题,但我找到了一个解决办法

而不是使用:

heroku运行rake数据库:迁移

您可以使用:


heroku运行:分离的rake数据库:迁移

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


这并不理想,但当你的人际网络不完善时,它会让你走出困境:)

这种情况似乎有不同的原因。对我来说,结果是我安装了一个旧版本的Heroku工具带。这是在自我更新版本之前,我还安装了heroku gems的旧版本。在更新heroku工具带产生任何效果之前,必须移除这些工具

事实证明,这一页很有用。先读一读:

了解您使用的heroku toolbelt版本(如有),如下所示:

$ heroku version
heroku-toolbelt/2.xx.x 
brew upgrade heroku-toolbelt
如果它比版本2.32.0旧,则需要更新。如果您在响应中没有看到“heroku toolbelt”,则需要安装它

确保你先把任何旧的heroku宝石取下来运行下面的命令时询问我是否也要删除可执行文件。正确答案是肯定的如果您需要特定应用程序的gem,您可以随时在以后捆绑/安装

$ gem uninstall heroku --all
如果您正在使用rbenv,您可能需要重新设置:

$ rbenv rehash
清除旧的gems后,下载当前的heroku toolbelt并安装它。重新启动终端后,一切都应正常工作

编辑:

我必须确保我的rbenv路径没有设置在heroku cli路径前面。否则,旧heroku gem的任何捆绑/安装都会再次劫持heroku命令。我在我的~/.profile文件的末尾添加了导出路径行,因此它将附加在任何rbenv路径之前

$ vi ~/.profile
export PATH=/usr/local/heroku/bin:$PATH
重新加载终端表明,通过运行和路径不在/usr/local/heroku中,这是可行的

$ which heroku
/usr/local/heroku/bin/heroku

对我来说,升级heroku工具带和cli很有效。我使用的是
brew
,所以它看起来像这样:

$ heroku version
heroku-toolbelt/2.xx.x 
brew upgrade heroku-toolbelt

有意思。。我也有这个问题。ipfw列表返回-->65535 allow ip from any to anysolved-通过3G tether测试并收到响应,似乎不是防火墙;可能是代理,或ISP。Heroku使用通常被公司ISP禁止的端口会带来厄运,等等。太棒了!你知道这样运行rails c之后有没有执行命令的方法吗?heroku run:detached rake db:migrate为我工作!!干杯,谢谢,伙计……)是的,更新heroku CLI是我的解决方案。尽管heroku文档称cli将自动更新I hade以运行
heroku update
强制更新。