On windows, running Jruby 1.6.4 - this issue occurs in Sprockets 2.0.0 and 2.0.2, Rails 3.1.0 and 3.1.1. Using therubyrhino as the js runtime, but this also occurs when using execjs (which correctly finds jscript).
Spin up a sample Rails project with a scaffolded controller. Start the server. Edit the controller's css.scss file with any change & save. Refresh the page. On Mac/Linux - things are fine. However, on windows you receive a "same file" error. This happens every time you change the css.scss file - and you must run: rake assets:clean to get past it.
Same behavior for coffeescript files (though again, only on windows). Asked the sprockets guys, but they recommended I ask the Rails core team (which I have). Decided to fork the questioning here as well.
Any thoughts?
BTW, here's a sample of the error:
ActionView::Template::Error (same file: C:/DEV/Information_Center/rubyw/edist3/tmp/cache/assets/sprockets%2F25f4cb117025b2fbc2fb480688c87da0.6816.15608 and C:/DEV/Information_Center/rubyw/edist3/tmp/cache/assets/D34/450/sprockets%2F25f4cb117025b2fbc2fb480688c87da0):
3:
4: <%= yield :page_title %> | foo.com
5: <%= stylesheet_link_tag "application" %>
6: <%= stylesheet_link_tag "article" %>
7: <%= javascript_include_tag "application" %>
8: <%= javascript_include_tag "article" %>
9: <%= csrf_meta_tags %>
app/views/layouts/article.html.erb:6:in `_app_views_layouts_article_html_erb___1475428847_7158'
Rendered C:/DEV/programs/jruby-1.6.4/lib/ruby/gems/1.8/gems/actionpack- 3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms)
Rendered C:/DEV/programs/jruby-1.6.4/lib/ruby/gems/1.8/gems/actionpack- 3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
Rendered C:/DEV/programs/jruby-1.6.4/lib/ruby/gems/1.8/gems/actionpack- 3.1.1/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (0.0ms)
Rendered C:/DEV/programs/jruby-1.6.4/lib/ruby/gems/1.8/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
Rendered C:/DEV/programs/jruby-1.6.4/lib/ruby/gems/1.8/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (0.0ms)
Well - not much traction from the Rails core team just yet on this, but this workaround seems to allow sprockets and Rails to play a little nicer, via Jruby on Windows:
-add to development.rb
config.assets.cache_store = nil