samedi 28 mars 2015

Not included assets in rails app

My application.js (in app/assets/) looks like:



//= require jquery
//= require jquery_ujs
//= require_tree .


the problem is that generated HTML contains only (not the tree):



<script src="/assets/application.js?body=1" type="text/javascript"></script>


what I expected is e.g. jquery.js, etc.


This problem occurs only on my Mac OS X development machine. (tested also on OpenSuse - unix machine and everything works).


What I have tried:



  1. replace Gemfile.lock (now identical with unix machine except json ~> 1.8.2 instead of 1.8.0) and reinstall all gems:



gem uninstall --all
bundle install


  1. change ruby version (tested 1.9, 2.1, 2.2)

  2. googling around what is wrong with sprockets (without any success)

  3. elaborating with rake assets:precompile --track



** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
Compiled application.js (1ms) (pid 20541)
Compiled application.css (0ms) (pid 20541)

Ruby version 2.2, rails version 3.1.12. I could include Gemfile if necessary but bundle install works without any problem.


Aucun commentaire:

Enregistrer un commentaire