0
votes

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.

1
Is config.assets.enabled = true in application.rb?Kelsey Hannan
Yes, this line is included in application.rbgimli

1 Answers

0
votes

The solution (don't ask me why) was removing whole project folder and clone it again from git repository. (And yes "git status" was saying no change and everything-up-to-date).

The reason is probably some cache of rails on Mac OS X. Maybe someone can clear this behavior of webrick...