title: Ruby on Rails 6: Why doesn't receive(data) method work in ActionCable of my application?
body: <p>I'm working on a real time chat application in Rails 6 with Windows OS, and my ActionCable has an issue.</p>
  <p>The development adapter doesn't work at all(I guess), neither async, neither Redis. I tried everything but I am really stuck at this point :(.</p>
  <p>I have a channel called 'room', with the following coding on it's back-end side (app/channels/room_channel.rb):</p>
  <pre><code>class RoomChannel &lt; ApplicationCable::Channel
  def subscribed
      # stream_from &quot;some_channel&quot;
      reject unless params[:room_id]
  
      room = Room.find params[:room_id].to_i
      stream_for room
  end
  
  def unsubscribed
      # Any cleanup needed when channel is unsubscribed 
  end
  end
  </code></pre>
  <p>And in its front-end side: (app/javascript/room_channel.js):</p>
  <pre><code>import consumer from &quot;./consumer&quot;
  
  let url = window.location.href;
  let room_id = parseInt(url.substring(url.search(&quot;rooms/&quot;) + 6) );
  
  if (url.indexOf(&quot;rooms/&quot;) != -1) {
  
  console.log('Subscribed to room', room_id);
  
  consumer.subscriptions.create({ &quot;channel&quot;: &quot;RoomChannel&quot;, &quot;room_id&quot;: room_id }, {
    connected() {
      console.log('connected')
      // Called when the subscription is ready for use on the server
    },
  
    disconnected() {
      // Called when the subscription has been terminated by the server
    },
  
    received(data) {
      console.log('data received successfully')
      // Called when there's incoming data on the websocket for this channel
    }
  });
  }
  </code></pre>
  <p>When I run the server I am able to subscribe and connect to the channel, but the channel cannot receive any incoming data (in my case, messages). I know it because it doesn't output the console message ('data received successfully') when I create a new message in the room.</p>
  <p><strong>Other important information is</strong> when my co-worker runs this application with his computer with the same coding everywhere, he can receive data (he gets the 'data received successfully' output when he sends a message to the room). And as I said, we have the same exact coding everywhere!</p>
  <p>So I am sure about the fact that it is not the code's fault, the problem is with my computer or I don't know.</p>
  <p>Can anybody help me with this problem? Thanks for reading and waiting for the helpful people's answers! :)</p>