All threads / Not able to Subscribe

Ask A Question


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- `block in subscribe_to_channel' | /Users/dannieltung/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport- `block in run_callbacks' | /Users/dannieltung/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport- `wrap' | /Users/dannieltung/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/actioncable- `block (3 levels) in <class:Engine>'
Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.