title: Action Cable is not working with rails 5
body: <p>I am a beginner in Rails 5 and I am trying to implement web sockets in my app. I am trying to copy and run a test app at first and I figure out it is not working as it is not transmitting and receiving the data. <code>received: (data) -&gt;</code> is never called. I also observed that it never gets connected with my redis server either (which I installed with brew). I am pasting all the code below. Thanks in advance.</p>
  
  <pre><code>//room.coffee
  
  App.room = App.cable.subscriptions.create "RoomChannel",
  connected: -&gt; 
  # Called when the subscription is ready for use on the server 
  disconnected: -&gt; 
  # Called when the subscription has been terminated by the server 
  
  received: (data) -&gt; 
  alert(data['message'])
  speak: (message) -&gt; 
  @perform 'speak', message: message
  </code></pre>
  
  <p>room_chanel.rb</p>
  
  <pre><code># Be sure to restart your server when you modify this file. Action 
  Cable runs in a loop that does not support auto reloading.
  class RoomChannel &lt; ApplicationCable::Channel
  def subscribed
   stream_from "room_channel"
  end
  
  def unsubscribed
    # Any cleanup needed when channel is unsubscribed
  end
  
  def speak(data)
    ActionCable.server.broadcast "room_channel", message: data['message']
  end
  end
  </code></pre>
  
  <p>Gemfile</p>
  
  <pre><code>source 'https://rubygems.org'
  
  git_source(:github) do |repo_name|
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
    "https://github.com/#{repo_name}.git"
  end
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '~&gt; 5.0.2'
  
  # Use postgresql as the database for Active Record
  gem 'sqlite3'
  # Use Puma as the app server
  gem 'puma'
  # Use SCSS for stylesheets
  gem 'sass-rails', '~&gt; 5.0'
  # Use Uglifier as compressor for JavaScript assets
  gem 'uglifier', '&gt;= 1.3.0'
  # Use CoffeeScript for .coffee assets and views
  gem 'coffee-rails', '~&gt; 4.1.0'
  # See https://github.com/rails/execjs#readme for more supported runtimes
  # gem 'therubyracer', platforms: :ruby
  
  gem 'redis'
  
  # Use jquery as the JavaScript library
  gem 'jquery-rails'
  # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
  gem 'turbolinks', '~&gt; 5.x'
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  gem 'jbuilder', '~&gt; 2.0'
  # Use Redis adapter to run Action Cable in production
  # gem 'redis', '~&gt; 3.0'
  # Use ActiveModel has_secure_password
  # gem 'bcrypt', '~&gt; 3.1.7'
  
  # Use Capistrano for deployment
  # gem 'capistrano-rails', group: :development
  
  group :development, :test do
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console
    gem 'byebug', platform: :mri
  end
  
  group :development do
    # Access an IRB console on exception pages or by using &lt;%= console %&gt; anywhere in the code.
    gem 'web-console', '&gt;= 3.3.0'
    gem 'listen', '~&gt; 3.0.5'
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring'
    gem 'spring-watcher-listen', '~&gt; 2.0.0'
  end
  
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>
  
  <p>cable.yml</p>
  
  <pre><code># Action Cable uses Redis by default to administer connections, channels, and sending/receiving messages over the WebSocket.
  production:
    adapter: redis
    url: redis://localhost:6379/1
  
  development:
    adapter: redis
    url: redis://localhost:6379/1
  
  test:
    adapter: redis
    url: redis://localhost:6379/1
  </code></pre>
  
  <p>cable.coffee</p>
  
  <pre><code># Action Cable provides the framework to deal with WebSockets in Rails.
      # You can generate new channels where WebSocket features live using the rails generate channel command.
      #
      # Turn on the cable connection by removing the comments after the require statements (and ensure it's also on in config/routes.rb).
      #
      #= require action_cable
      #= require_self
      #= require_tree ./channels
      #
      @App ||= {}
      App.cable = ActionCable.createConsumer()
  </code></pre>