Ask A Question

Notifications

You’re not receiving notifications from this thread.

Not able to Subscribe

Danniel Tung asked in Ruby

Hi there! Im pretty new to programming and have been taking the Multiple Chatroom lessons but....
Getting this error...can somebody help me with it?

Started GET "/cable" for ::1 at 2021-05-14 17:47:20 -0300
Started GET "/cable/" [WebSocket] for ::1 at 2021-05-14 17:47:20 -0300
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
Could not execute command from ({"command"=>"subscribe", "identifier"=>"{\"channel\":\"MessageChannel\",\"id\":\"1\"}"}) [NameError - undefined local variable or method `current_user' for #<MessageChannel:0x00007fe698e41d68>]: /Users/dannieltung/code/dannieltung/SLACK-GoRails/app/channels/message_channel.rb:4:in `subscribed' | /Users/dannieltung/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/actioncable-6.0.3.7/lib/action_cable/channel/base.rb:181:in `block in subscribe_to_channel' | /Users/dannieltung/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:112:in `block in run_callbacks' | /Users/dannieltung/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-6.0.3.7/lib/active_support/execution_wrapper.rb:84:in `wrap' | /Users/dannieltung/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/actioncable-6.0.3.7/lib/action_cable/engine.rb:68:in `block (3 levels) in <class:Engine>'
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,796+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.