Why did Rails4 drop support for “assets” group in the Gemfile

Previously the assets group existed to avoid unintended compilation-on-demand in production. As Rails 4 doesn’t behave like that anymore, it made sense to remove the asset group.

This is explained in more detail in the commit that changed that. I extracted some quotes with the actual answer.

Some gems can be needed (in production) like coffee-rails if you are using coffee templates
and the fact that now assets are not precompiled on demand in production anymore.

(not precompiled on demand in production) Means that if you have that gems in production environment in 3.2.x and forget to precompile, Rails will do exactly what it does in development, precompile the assets that was requested. This is not true anymore in Rails 4, so if you don’t precompile the assets using the tasks you will get a 404 when the assets are requests.

Leave a Comment