我只想将“excanvas.min.js”文件提供给 Internet Explorer 而不是其他浏览器。
所以我在我的application.html.erb
:
<!--[if lt IE 9]>
<%= javascript_include_tag 'excanvas.min'
# Excanvas for use of Canvas in IE up to version 8
%>
<![endif]-->
<%= javascript_include_tag 'application' %>
但我收到以下错误(在生产中):
Completed 500 Internal Server Error in 3ms
ActionView::Template::Error (excanvas.min.js isn't precompiled)
强制 Rails 预编译文件时也会发生错误
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
config.assets.precompile += %W(excanvas.min.js,other_file.css,even_anotherfile.js)
在“配置/生产.rb”中。我究竟做错了什么?
我可以做一个
//= require excanvas.min
在application.js
. 但这将包括每个浏览器的文件......
信息:我从 Rails 3.0 应用程序进行了更新。