Skip to content

Instantly share code, notes, and snippets.

@nateberkopec
Last active March 17, 2022 08:21
Show Gist options
  • Save nateberkopec/1184c81a92c10d84d779 to your computer and use it in GitHub Desktop.
Save nateberkopec/1184c81a92c10d84d779 to your computer and use it in GitHub Desktop.
ActionCable isn't *really* a Rails 5 dependency.
# Existing applications upgrading to Rails 5 that don't want ActionCable
# config/application.rb
# require 'rails/all'
require "rails"
# same as rails/all.rb, but remove actioncable
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
# require "action_cable/engine"
require "sprockets/railtie"
require "rails/test_unit/railtie"
# gem 'rails'
gem "activerecord"
gem "actionpack"
gem "actionview"
gem "actionmailer"
gem "activejob"
gem "activesupport"
gem "railties"
gem "sprockets-rails"
gem 'sqlite3'
# If you do this, you don't need to change config/application.rb.
# This has the side effect of not even *installing* ActionCable's gem dependencies.
# via @derekprior
rails new --skip-action-cable
@monfresh
Copy link

The Gemfile solution will only work if none of your dependencies have the rails gem as a dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment