在Windows上,运行Jruby 1.6.4 - 此问题发生在Sprockets 2.0.0和2.0.2,Rails 3.1.0和3.1.1中。使用therubyrhino作为js运行时,但是当使用execjs(正确找到jscript)时也会发生这种情况。
使用脚手架控制器启动示例Rails项目。启动服务器。使用任何更改&编辑控制器的css.scss文件。保存。刷新页面。在Mac / Linux上 - 事情很好。但是,在Windows上,您收到“相同文件”错误。每次更改css.scss文件时都会发生这种情况 - 您必须运行:rake assets:clean以通过它。
coffeescript文件的相同行为(尽管再次,仅在Windows上)。问链轮人员,但他们建议我问Rails核心团队(我有)。决定在这里提出质疑。
有什么想法吗?
BTW,这是错误的一个示例:
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)
答案 0 :(得分:0)
嗯 - Rails核心团队还没有太大的吸引力,但这个解决方案似乎允许sprockets和Rails在Windows上通过Jruby发挥更好的效果:
-add to development.rb
config.assets.cache_store = nil