How can I temporarily remove Action Cable from starting with my server for debugging?

I’m trying to debug an issue with my application and I’m wanting to remove Action Cable temporarily. How can I do this, where when the server starts Action Cable doesn’t, yet I don’t have to remove all my code that I’ve already put in place? Thanks!

Do you have controller methods or initializers that call ActionCable directly by name? Because if not, I suppose just commenting out that gem and bundling and restarting would get "rid" of it temporarily. But if you had any code that called it, that would bomb and your app would not start up. I suspect you're going to have to go through the app and put a feature flag around the whole thing, so you can turn it off and on with a config variable.


Well as far as I know the Action Cable gem is a dependency of ActiveSupport ? So I can’t comment out that line in my Gemfile.

In application.rb you can require all of rails modules with require rails/all. To not require modules, you have to require them specifically:

require “active_model/railtie”

require “active_job/railtie”

require “active_record/railtie”

require “action_controller/railtie”

require “action_mailer/railtie”

require “action_cable/railtie”
require “action_view/railtie”
require “sprockets/railtie”

To remove ActionCable, you would remove require “action_cable/railtie”