简体   繁体   中英

rake assets:precompile compiling everything twice

I'm having some trouble with Rails assets pre-compilation that I've never come across before. When running rake assets:precomile in this app I'm seeing every asset getting compiled twice. If I tail production.log I can see that it basically seems to be running the whole command twice in a row. Here's a modified sample from the logs...

Connecting to database specified by database.yml
Compiled jquery.js  (97ms)  (pid 56296)
Compiled jquery.cycle.all.js  (2ms)  (pid 56296)
Compiled jquery.numeric.js  (0ms)  (pid 56296)
Compiled matchMedia.js  (0ms)  (pid 56296)
Compiled fastclick.js  (1ms)  (pid 56296)
... etc ...
Connecting to database specified by database.yml
Compiled jquery.js  (97ms)  (pid 56296)
Compiled jquery.cycle.all.js  (2ms)  (pid 56296)
Compiled jquery.numeric.js  (0ms)  (pid 56296)
Compiled matchMedia.js  (0ms)  (pid 56296)
Compiled fastclick.js  (1ms)  (pid 56296)
... etc ...

Checking the compiled files confirms that it has compiled everything twice so all of the CSS & JS is duplicated.

I'm using Rails 3.2.13 and Ruby 2.0.0-p0 (also tried with 1.9.3-p392).

I've never had any issues with assets pre-compilation before so if anyone has any ideas on why it's exhibiting this unusual behaviour this time I'd love to hear it.

Cheers!

To explain a bit more about alistairholt's "gotcha": when running rake assets:precompile the assets are precompiled and placed in public/assets . It turns out this gives conflicts when loading the web app in the development environment, because it serves both the files from public/assets and the assets from the app/assets folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM