我在 apache Web 服务器上使用 phusion passanger 部署我的应用程序。我正在使用 dojo 样板项目进行 js/css 缩小。在生产中,我看到如下错误:
ActionController::RoutingError (No route matches [GET] "/dojo/dist/app/resources/design/font/fontawesome-webfont.eot)%20format(\"eot\"),%20url(design/font/fontawesome-webfont.woff)%20format(\"woff\"),%20url(design/font/fontawesome-webfont.ttf)%20format(\"truetype\"),%20url(design/font/fontawesome-webfont.svg)%20format(\"svg\""):
我的 dist 目录中有文件,但不明白为什么浏览器要求
"/dojo/dist/app/resources/design/font/fontawesome-webfont.eot)%20format(\"eot\"),%20url(design/font/fontawesome-webfont.woff)%20format(\"woff\"),%20url(design/font/fontawesome-webfont.ttf)%20format(\"truetype\"),%20url(design/font/fontawesome-webfont.svg)%20format(\"svg\""
代替
"/dojo/dist/app/resources/design/font/fontawesome-webfont.eot"
我的CSS看起来很正常:
@font-face {
font-family: "FontAwesome";
src: url("design/font/fontawesome-webfont.eot");
src: url("design/font/fontawesome-webfont.eot") format('eot'), url("design/font/fontawesome-webfont.woff") format('woff'), url("design/font/fontawesome-webfont.ttf") format('truetype'), url("design/font/fontawesome-webfont.svg") format('svg');
font-weight: normal;
font-style: normal;
}
编辑:显然它与使用旧 Internet Explorer 的客户端有关,而不是部署环境。
这是提供有关此事的一些信息的链接:
http://www.nczonline.net/blog/2011/04/05/lessons-on-font-face-from-the-f2e-summit/