We are trying to deploy a simple Rails 5 DHH demo for a stand-alone standalone EC2 instance on AWS. The code is available here: https://github.com/HectorPerez/chat-in-rails5
We used Elastic Beanstalk to rotate one instance this way:
eb create dev-env -p "64bit Amazon Linux 2015.09 v2.0.4 running Ruby 2.2 (Puma)" βsingle -i t2.micro
This is a minimal installation, so there is no Elasticache and no load balancing. To install redis on an EC2 instance, we added the .ebextensions configuration file as follows: https://gist.github.com/KeithP/08b38189372b7fd241e5#file-ebextensions-redis-config ; Git commit and deploy.
But websocket does not work: checking the browser console, we repeat this error again and again:
application-a57354de3399cd895ca366df9bd7316ab69e81d266b63be7d7be563ebc78ab9d.js:27 WebSocket connection to 'ws://dev-env-y2e5dcrxqk.elasticbeanstalk.com/cable' failed: Error during WebSocket handshake: Unexpected response code: 404

The production.log server shows 2 "Start GET / Cable" for each "Finish / Cable" call. No DEBUG posts from ActiveCable:
/var/app/containerfiles/logs/production.log ------------------------------------- INFO -- : Processing by RoomsController#show as HTML DEBUG -- : [1m[36mMessage Load (0.1ms)[0m [1m[34mSELECT "messages".* FROM "messages"[0m INFO -- : Rendered collection (0.0ms) INFO -- : Rendered rooms/show.html.erb within layouts/application (0.5ms) INFO -- : Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.1ms) INFO -- : Started GET "/cable" for <ip_address> at 2016-01-01 17:28:26 +0000 INFO -- : Started GET "/cable/" for <ip_address> at 2016-01-01 17:28:26 +0000 INFO -- : Finished "/cable/" for <ip_address> at 2016-01-01 17:28:26 +0000
amazon-web-services ruby-on-rails-5 deployment redis actioncable
Keithp
source share