I try to make a simple chat on RoR, I do this for this video.

https://www.youtube.com/watch?v=kJbuZecN1c8

at the stage of checking the connection websocket in the console displays the following error

WebSocket connection to 'ws://localhost:3000/cable' failed: Error during WebSocket handshake: Unexpected response code: 500 

what it can be connected with, and what are the possible solutions?

link to the repo https://github.com/movcode/Rails-WebSocket-Example

  • one
    500 is usually an unrecognized exception, open the logs, there must be details. - D-side
  • the logs return the error Started GET "/cable" for 127.0.0.1 at 2018-04-06 18:19:44 +0300 LoadError (/home/alexandr/.rvm/gems/ruby-2.4.2/gems/nio4r-2.3.0/lib/nio4r_ext.so: undefined symbol: rb_cFixnum - /home/alexandr/.rvm/gems/ruby-2.4.2/gems/nio4r-2.3.0/lib/nio4r_ext.so): - Alexander Honor
  • @ D-side Understood, thanks for the hint, just installed gem install nio4r -v '2.3.0' - Alexander Honor

1 answer 1

It was just necessary to install gem install nio4r -v '2.3.0'

  • Curious. And how did it happen that this gem was installed , but wrong / not completely? - D-side
  • Not long before that, I had some minor problems with sidekiq, cron and whenever they for some reason did not want to work together, there were some rather strange solutions, to install a gemi bandl in the vendor / cache directory, I already learned about sidekiq-cron and did everything Normally, while removing everything from the vendor / cache, I assume that there could be some kind of relationship. I think something like this - Alexander Honor