使用heroku生产Rails 5

时间:2016-01-21 23:39:25

标签: heroku websocket puma ruby-on-rails-5 actioncable

我在heroku上使用带有actioncable的rails 5,我只在生产中出现此错误

WebSocket connection to 'wss://adham-chatty.heroku.com/cable' failed: WebSocket opening handshake was canceled

我认为因为美洲狮

2016-01-21T23:33:56.372977+00:00 heroku[web.1]: Starting process with command `bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}`
2016-01-21T23:33:57.651242+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-01-21T23:33:58.721808+00:00 app[web.1]: [3] - Gracefully shutting down workers...
2016-01-21T23:33:58.873303+00:00 app[web.1]: [3] === puma shutdown: 2016-01-21 23:33:58 +0000 ===
2016-01-21T23:33:58.873305+00:00 app[web.1]: [3] - Goodbye!
2016-01-21T23:33:58.910391+00:00 app[web.1]: [3] Puma starting in cluster mode...
2016-01-21T23:33:58.910405+00:00 app[web.1]: [3] * Version 2.15.3 (ruby 2.2.3-p173), codename: Autumn Arbor Airbrush
2016-01-21T23:33:58.910407+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2016-01-21T23:33:58.910409+00:00 app[web.1]: [3] * Environment: production
2016-01-21T23:33:58.910429+00:00 app[web.1]: [3] * Process workers: 2
2016-01-21T23:33:58.910453+00:00 app[web.1]: [3] * Preloading application
2016-01-21T23:33:59.632680+00:00 heroku[web.1]: Process exited with status 0

1 个答案:

答案 0 :(得分:0)

我只是度过了一个晚上,让我的rails 5 ActionCable应用程序在Heroku上运行得非常好。我在经历了很多箍之后写下了我学到的东西:http://www.whodya.com/posts/19632。我在查看上面的错误消息时猜测的是,咳咳,我有点问题。您尝试使用wss:进行连接,但这只适用于您在服务器上使用SSL / HTTPS的情况。尝试ws:相反,直到你启动并运行HTTPS。同样,我的文章在这里(http://www.whodya.com/posts/19632),我的配置/设置等等。

-John