Heroku是否支持ActionController :: Live? [英] Does Heroku support ActionController::Live?

查看:142
本文介绍了Heroku是否支持ActionController :: Live?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Heroku上托管了一个Rails应用程序,并且我想添加Server Sent Events功能,但是我找不到任何特定于Heroku的文档或博客帖子。



因为并非所有服务器(例如WEBrick)都支持ActionController :: Live,我想知道Heroku上的默认服务器是什么,以及是否可以配置环境(即更改服务器)以支持SSE。



有关服务器的使用以及如何配置的任何进一步的建议将不胜感激。

解决方案

我认为我的答案并不是那么有帮助,但你可以试试。



第一件事:

create <一个href =https://devcenter.heroku.com/articles/procfile =nofollow> Procfile 在rails根目录下的内容如下:

  web:bundle exec rails server puma -p $ PORT -e $ RACK_ENV 

然后添加到Gemfile中:

  gem'puma'
瘦,但考虑下面的链接(以及更多细节)



http:// tenderlovemaking。 com / 2012/07/30 / is-it-live.html


I have a Rails app hosted on Heroku and I want to add Server Sent Events functionalities, but I can't find any documentation or blog post specific for Heroku.

As not all servers (e.g. WEBrick) support ActionController::Live I was wondering what is the default server on Heroku and whether is possible to configure the environment (i.e. change server) to support SSEs.

Any further advice about the server to use and how to configure would be greatly appreciated.

解决方案

I think my answer is not so widely helpfull, but you can try.

For the first thing:

create Procfile in rails root within the following content:

web: bundle exec rails server puma -p $PORT -e $RACK_ENV

then add to Gemfile:

gem 'puma'

In above you can switch to thin, but consider link below (and many more details)

http://tenderlovemaking.com/2012/07/30/is-it-live.html

这篇关于Heroku是否支持ActionController :: Live?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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