0

Hello Is there someone out there who can explain this error to me. It works on local machine and also when using heroku local but as soon as it's run on heroku production it gives me this error and i have done all the testing and also tried to get some more error data but no luck.

What's in Use: heroku, sidekiq, actioncable, ruby on rails 5.0.1

[ActionCable] [test@mail.com] Could not execute command from {"command"=>"message", "identifier"=>"{\"channel\":\"RoomChannel\"}", "data"=>"\"message:message\""}) 
[NoMethodError - undefined method `except' >for "message: message":String
2017-02-06T00:48:33.207838+00:00 app[web.1]:
Did you >mean?  exec]:       /app/vendor/bundle/ruby/2.3.0/gems/actioncable->
5.0.1/lib/action_cable/channel/base.rb:272:in `block in   action_signature' 
| /app/vendor/bundle/ruby/2.3.0/gems/actioncable-  5.0.1/lib/action_cable/channel/base.rb:271:in `tap' 
| /app/vendor/bundle/ruby/2.3.0/gems/actioncable-  5.0.1/lib/action_cable/channel/base.rb:271:in `action_signature' 
|   /app/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/channel/base.rb:169:in   `perform_action' 
| /app/vendor/bundle/ruby/2.3.0/gems/actioncable-  5.0.1/lib/action_cable/connection/subscriptions.rb:53:in `perform_action'

room.coffe

App.room = App.cable.subscriptions.create "RoomChannel",
connected: ->
console.log "live"
# 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
# Called when there's incoming data on the websocket for this channel
$messages = $('#messages')
$messages.append data
$messages.scrollTop $messages.prop('scrollHeight')

speak: (message) ->
console.log message
@perform 'speak', message: message

room_channel.rb

class RoomChannel < ApplicationCable::Channel
 def subscribed
  stream_from "room_channel"
 end

 def unsubscribed
 # Any cleanup needed when channel is unsubscribed
 end

 def speak(data)
  Message.create! content: data['message'], user: current_user
  end
 end

BroadcastMessageJob.rb

class BroadcastMessageJob < ApplicationJob
queue_as :default

def perform(message)
 ActionCable.server.broadcast 'room_channel', render_message(message)
end

private
def render_message(message)
 ApplicationController.renderer.render message
 end
end

model message.rb

 class Message < ApplicationRecord
 belongs_to :user
 after_create_commit { BroadcastMessageJob.perform_later self }

Thank you in advance.

EVX
  • 304
  • 4
  • 17
  • Can you show the code that is throwing the error? –  Feb 07 '17 at 17:47
  • @Noah sure thing i have updated the first post with the code. – EVX Feb 07 '17 at 18:45
  • i know now that there is nothing wrong with my code it's the redis + sidekiq that is not working as it should i managed to track down log and got this: Your Redis connection pool is too small for Sidekiq to work. Your pool has 2 connections but really needs to have at least 7 How do i move on from this point i now know i need to increase the pool somehow any ideas? – EVX Feb 07 '17 at 21:36

0 Answers0