uninitialized constant > ActionCable::Server::Configuration::ApplicationCable

后端 未结 4 1855
伪装坚强ぢ
伪装坚强ぢ 2021-01-04 06:23

When I am running server its throwing error shown in logs below. I googled a lot but didn\'t get reason behind it. Somebody please put some light on it.

Gemfile

相关标签:
4条回答
  • 2021-01-04 06:35

    According to DHH's video tutorial from yesterday, there's an issue between Spring and an ActionCable dependency, so until the final release of Rails 5 you will need to recreate your project with the --skip-spring option.

    0 讨论(0)
  • 2021-01-04 06:43

    I had the same problem when trying to use ActionCable with Rails 4.2.5 and the solution was to add the following to config/application.rb:

    config.autoload_paths += %W(#{config.root}/app/channels)
    

    This is with the ActionCable gem:

    gem 'actioncable', github: 'rails/actioncable', branch: 'archive'
    
    0 讨论(0)
  • 2021-01-04 06:55

    The error is related to not having the correct ActionCable files in your project. You need app/channels/application_cable/channel.rb that looks like this

    module ApplicationCable
      class Channel < ActionCable::Channel::Base
      end
    end
    

    and app/channels/application_cable/connection.rb

    module ApplicationCable
      class Connection < ActionCable::Connection::Base
      end
    end
    
    0 讨论(0)
  • 2021-01-04 07:00

    If you upgraded from previous version (when actioncable was not in the bundle), check if config/application.rb contains

    require "action_cable/engine"
    
    0 讨论(0)
提交回复
热议问题