Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to Deploy ActionCable and Rails 5 To Production Discussion

Nice! This is pretty much what we also recommend in our upcoming Action Cable integration documentation.

One thing that I'd like to add is that you will need to configure config/cable.yml to specify either redis or postgresql as adapter. Rails 5 is going to default to the in-process 'async' adapter, but that adapter does not work when multiple processes are involved (as is the case with Passenger).

Reply

I forgot about that until after I finished recording! The actioncable-examples repository that I cloned still used the Redis adapter default, so I totally overlooked that change. Great to know.

Reply

@honglilai:disqus @excid3:disqus so, does that mean if we are not specifying either redis or postgresql as adapter, the chat message couldn't be saved into our app database?

Reply

Thanks Chris for this great tutorial! I've 2 questions:

1. Can we use this setup on Heroku?

2. Currently, I'm using Puma server on Heroku which only allow 16 concurrent connection at a time https://devcenter.heroku.co...

My question, if we use Passenger, can we get the 'unlimited' concurrent connection?

Reply

I'm going to be doing some testing on Heroku to see, but I think you'll be fine using Puma on there still.

Reply

Thanks, I just successfully deploy to passenger and Pg as backend, my chat repository is https://github.com/Eric-Guo...

Reply

Great Tutorial. Chris, can you use a larger font while recording the screencast. The small font is hard to read. Thanks

Reply
Dinesh Atoliya Dinesh Atoliya

Nice tutorial! I am trying send notification if a logged in user get invited. Any idea, how do I track if a user is logged in or not ? Any hint or help would be great.

Reply

Hi, So I am trying to deploy an app that has actioncable on heroku. However, I don't have the index.coffee file in javascripts since I have used the js file instead like on the group chat with action cable series on here.
How do I go about deploying my app on heroku, knowing that it has actioncable?
Thank you!

Reply

I don't believe there are any necessary changes for Heroku. You should be able to just deploy it, making sure that your allowed request origins match the domain you're running on.

Reply

Could not make it work!

Set: index.coffee, route.rb, development.rb and production.rb , set nginx with and without pasenger and get the same error!

WebSocket connection to 'ws://example.com/cable' failed: Error during WebSocket handshake: Unexpected response code: 404

Could some one help me?

Reply

I got the same problem with Diogo Wernick. I got this error:

WebSocket connection to 'ws://example.com/cable' failed: Error during WebSocket handshake: Unexpected response code: 404

And also when I open production.log on the server, I see this error:

WebSocket error occurred: One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0

Here is the link to the thread which has more details:
https://gorails.com/forum/websockets-with-rails-passenger-error-during-websocket-handshake-unexpected-response-code-400

Please help.

Reply

I'm using elasticbeanstalk with ruby 2.6 that comes with passenger 4.0.60.
I'm having issue with connection eastablishment.
I did some research on the internet then I found that action cable support comes after passenger 5 but we can't upgrade the passenger in elasticbeanstalk. Is there any way I can implement action cable in my current infrastructure?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,733+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.