Skip to content

Instantly share code, notes, and snippets.

@simonrobson
Last active July 29, 2019 01:28
Show Gist options
  • Save simonrobson/6137148 to your computer and use it in GitHub Desktop.
Save simonrobson/6137148 to your computer and use it in GitHub Desktop.
Disable asset pipeline in Rails 4
Comment in Gemfile:
# Use SCSS for stylesheets
# gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
# gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
# gem 'coffee-rails', '~> 4.0.0'
config/application.rb:
# split out components and comment sprockets
# require 'rails/all'
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
# require "sprockets/railtie"
require "rails/test_unit/railtie"
class Application < Rails::Application
# turn pipeline off
config.assets.enabled = false
end
@Senen
Copy link

Senen commented Sep 28, 2018

Thanks @simonrobson! This helped me to remove assets pipeline from a Rails 5.2 project making a few addional changes:

After commenting require sprockets/railtie from application.rb file we has no more access to assets pipeline configuration so we will need to remove assets.rb file, and all references to Rails.application.config.assets from your application, environment and initializers files.

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