問題
Action CableでWebsocketが繋がらない。
bashには下の様なログがひたすら出続ける。
bash
Started GET "/cable" for 10.0.2.2 at 2019-04-08 08:30:09 +0100
Started GET "/cable/" [WebSocket] for 10.0.2.2 at 2019-04-08 08:30:09 +0100
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
RoomChannel is transmitting the subscription confirmation
Started GET "/cable" for 10.0.2.2 at 2019-04-08 08:30:09 +0100
Started GET "/cable/" [WebSocket] for 10.0.2.2 at 2019-04-08 08:30:09 +0100
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
RoomChannel is transmitting the subscription confirmation
Started GET "/cable" for 10.0.2.2 at 2019-04-08 08:30:18 +0100
Started GET "/cable/" [WebSocket] for 10.0.2.2 at 2019-04-08 08:30:18 +0100
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
RoomChannel is transmitting the subscription confirmation
原因
config/environments/development.rbで以下の設定をしていた事が原因だった。
config/environments/development.rb
config.reload_classes_only_on_change = false
解法
コメントアウトするか削除すればよい。