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

asset-pipeline, ruby, ruby-on-rails

Solution

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' 

Problem

The rails asset pipeline isn't including files required in application.js. The only javascript file rendered to the browser is application.js, and the require lines are not compiled to include tags as they should be: ``` // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // the compiled file. // // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD // GO AFTER THE REQUIRES BELOW. // //= require jquery //= require jquery_ujs //= require twitter/bootstrap //= require bootstrap //= require_tree . ; ``` in config/application.rb I have `config.assets.enable = true` I'm using rails 3.2.8, and I've tried ruby 1.9.3-p398 and 2.0.0-p0 installed using rvm. How do I get application.js to include the files required? EDIT: It looks like the lock on this question was recently unlocked, and activity has increased. It has been a while since I worked on this, and the code doesn't exist anymore. If I am remembering correctly I reinstalled ruby and rails and that fixed the problem. Should I close this question? What is the proper procedure in this situation?

Original source

Related problems