Do you have these lines in your config/application.rb
file (right after all the require
lines):
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
Then you can just put your asset type stuff (coffee-rails and sass-rails etc) into the development
group and it won't be required in production.
You can also take a look at this SO answer for an explanation of why assets
group was specifically removed:
Why did Rails4 drop support for "assets" group in the Gemfile