Skip to content

Instantly share code, notes, and snippets.

@samanthamjohn
Last active December 15, 2015 07:59
Show Gist options
  • Save samanthamjohn/5227948 to your computer and use it in GitHub Desktop.
Save samanthamjohn/5227948 to your computer and use it in GitHub Desktop.
How to set up the asset pipeline for rails 4.
config.assets.compress = false
group :assets do
gem 'sass-rails', '~> 4.0.0.beta1'
gem 'coffee-rails', '~> 4.0.0.beta1'
gem 'sprockets-rails', :require => 'sprockets/railtie'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'uglifier', '>= 1.0.3'
end
# Compress JavaScripts and CSS
config.assets.compress = true
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = true
config.assets.configure do |env|
env.js_compressor = :uglify # or :closure, :yui
env.css_compressor = :sass # or :yui
env.logger = Rails.logger
env.cache = ActiveSupport::Cache::FileStore.new("tmp/cache/assets")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment