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

428 views
Skip to first unread message

David McDonald

unread,
Jan 4, 2018, 2:34:58 PM1/4/18
to Ruby on Rails: Talk
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!

Walter Lee Davis

unread,
Jan 4, 2018, 3:32:17 PM1/4/18
to rubyonra...@googlegroups.com
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.

Walter

> On Jan 4, 2018, at 2:34 PM, David McDonald <dave...@gmail.com> wrote:
>
> 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!
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f2b25b5c-1dfa-4800-a3b4-49052265f487%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

David McDonald

unread,
Jan 5, 2018, 8:47:14 AM1/5/18
to Ruby on Rails: Talk
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.

Shane Cavanaugh

unread,
Jan 12, 2018, 1:09:40 PM1/12/18
to Ruby on Rails: Talk
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"

Shane
Reply all
Reply to author
Forward
0 new messages