title: Actioncable works locally but not after deploying to Heroku - Rails & React
body: <p>I am using actioncable for a chat feature. It works perfectly when I test locally, but when I deploy to Heroku I get this error: </p>
  
  <p>'WebSocket connection to 'wss://dg-automotive-portal- 
  rails.herokuapp.com/cable' failed: Error during WebSocket handshake: Unexpected response code: 404'</p>
  
  <p>production.rb: </p>
  
  <pre><code>  config.action_cable.url = 'wss://dg-automotive-portal- 
    rails.herokuapp.com/cable'
    config.action_cable.allowed_request_origins = [
    'https://dg-automotive-portal.herokuapp.com/', 'http://dg- 
     automotive-portal.herokuapp.com/' ]
  </code></pre>
  
  <p>cable.yml: </p>
  
  <pre><code>  production:
    adapter: redis
    url:redis:MYURL
  </code></pre>
  
  <p>routes.rb has </p>
  
  <pre><code>  mount ActionCable.server =&gt; '/cable'
  </code></pre>
  
  <p>And I have the redis gem installed. Does anyone know why this doesn't work when I deploy?</p>
  
  <p>Javascript code called on componentWillMount: </p>
  
  <pre><code>  createSocket() {
        let cable = Cable.createConsumer('wss://dg-automotive-portal-rails.herokuapp.com/cable')
        this.chats = cable.subscriptions.create({
       channel: 'ChatChannel'
      }, {
        connected: () =&gt; {
          console.log("connected!")
       },
       received: (data) =&gt; {
         this.setState({
           chatLogs: [...this.state.chatLogs, data]
         })
       },
       create: function(chatContent, datetime, currentUser) {
         this.perform('create', {
          content: chatContent,
          time: datetime,
          user_id: currentUser
        })
      }
    })
  }
  </code></pre>