Rails asset pipeline not including required files in application.js manifest Rails asset pipeline not including required files in application.js manifest ruby ruby

Rails asset pipeline not including required files in application.js manifest


I answered this here:

Rails 3.2.8 Application.js and Application.css are not working as expcted

Here's the text:

I was also having this issue but with newer versions of Rails and Ruby.

Examining the log, I was being served javascript.js from Rails cache as the server didn't see a change in the file. I went and moved the require lines around (just one) to tell Rails that there's a change in the file and re-compile/use. Wellm that did it for me!

Hope it helps somebody.

Another important finding is to upgrade your sprockets gem in your Gemfile.

I had version 2.2.1 and had issues, after upgrading to 2.2.2, it worked

gem 'sprockets', '2.2.2' 


If you are upgrading from 3.0.x - 3.1.x and run in to this issue upgrade to 3.2.x and It may solve this issue.

I recently upgraded an app from 3.0 - 3.1.12 and found the asset manifest would not work using Ruby 1.9.3, Ruby 2.0, or Ruby 2.1.1. I then went ahead and upgraded to 3.2.17 and everything seems to be working correctly using Ruby 2.1.1.

Hopefully this helps anyone else that may run in to this issue upgrading.


One common reason for this is that the assets are compiled and found in public/assets, in which case Rails will not recompile them. If you have assets in here, and have not set config.serve_static_assets to false, then Rails will not recompile your assets:

config.serve_static_assets = false

So if you have precompiled stuff in public/assets, either delete them, or add the above line to development.rb