twitter-bootstrap – 变量@fontAwesomeEotPath_iefix是未定义的

前端之家收集整理的这篇文章主要介绍了twitter-bootstrap – 变量@fontAwesomeEotPath_iefix是未定义的前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用bootstrap工作我的第一个项目,我得到这个错误,当我尝试和查看我的项目。我已经环顾四周,却找不到有同样问题的人。任何帮助将是伟大的!提前致谢。

Less :: ParseError in Search#index

  1. Showing /Users/Basil/DropBox/College/CS 50/playedby.me/app/views/layouts/application.html.erb where line #4 raised:
  2.  
  3. variable @fontAwesomeEotPath_iefix is undefined
  4. (in /Users/Basil/DropBox/College/CS 50/playedby.me/app/assets/stylesheets/bootstrap_and_overrides.css.less)
  5. Extracted source (around line #4):
  6.  
  7. 1: <!DOCTYPE html>
  8. 2: <html>
  9. 3: <head>
  10. 4: <%= stylesheet_link_tag 'application.css',:media => "all" %>
  11. 5: <%= javascript_include_tag "application" %>
  12. 6: <%= csrf_Meta_tags %>
  13. 7: </head>

这是我的bootrstrap_and_overrides.css.less

  1. @import "twitter/bootstrap/bootstrap";
  2. body {
  3. padding-top: 60px;
  4. }
  5.  
  6. @import "twitter/bootstrap/responsive";
  7.  
  8. // Set the correct sprite paths
  9. @iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
  10. @iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
  11.  
  12. // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
  13. // Note: If you use asset_path() here,your compiled boostrap_and_overrides.css will not
  14. // have the proper paths. So for now we use the absolute path.
  15. @fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
  16. @fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
  17. @fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
  18. @fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
  19.  
  20. // Font Awesome
  21. @import "fontawesome";
  22.  
  23. // Your custom LESS stylesheets goes here
  24. //
  25. // Since bootstrap was imported above you have access to its mixins which
  26. // you may use and inherit here
  27. //
  28. // If you'd like to override bootstrap's own variables,you can do so here as well
  29. // See http://twitter.github.com/bootstrap/less.html for their names and documentation
  30. //
  31. // Example:
  32. // @linkColor: #ff0000;
  33.  
  34. @successBackground: white;
  35. @successText: @green;
  36. @errorBackground: white;
  37. @errorText: @red;
  38.  
  39. @navbarHeight: 60px;
  40.  
  41. .alert-success,.alert-error {
  42. border: 10px solid @green;
  43. padding: 2%;
  44. font-size: 125%;
  45. line-height: 150%;
  46. }
  47.  
  48. .alert-success {
  49. border-color: @green;
  50. }
  51.  
  52. .alert-error {
  53. border-color: @red;
  54. }

解决方法

请注意,您的bootstrap_and_overrides.css.less没有错误所抱怨的变量。

添加以下行与其他@fontAwesome变量,你应该是好的。

  1. @fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot#iefix");

或者通过运行rails g bootstrap:install -f更新你的twitter bootstrap安装。

猜你在找的Bootstrap相关文章