可变@fontAwesomeEotPath_iefix未定义(variable @fontAweso

2019-08-03 13:12发布

我的工作我的自举的第一个项目,每当我试图和查看项目中,我得到这个错误。 我环顾四周,并没有能够找到一个具有同样的问题。 任何帮助将是巨大的! 提前致谢。


少:: ParseError在搜索#指数

Showing /Users/Basil/Dropbox/College/CS 50/playedby.me/app/views/layouts/application.html.erb where line #4 raised:

variable @fontAwesomeEotPath_iefix is undefined
  (in /Users/Basil/Dropbox/College/CS 50/playedby.me/app/assets/stylesheets/bootstrap_and_overrides.css.less)
Extracted source (around line #4):

1: <!DOCTYPE html>
2: <html>
3: <head>
4:   <%= stylesheet_link_tag    'application.css', :media => "all" %>
5:   <%= javascript_include_tag "application" %>
6:   <%= csrf_meta_tags %>
7: </head>

这里是我的bootrstrap_and_overrides.css.less

@import "twitter/bootstrap/bootstrap";
body { 
padding-top: 60px;
}

@import "twitter/bootstrap/responsive";

// Set the correct sprite paths
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not 
//       have the proper paths. So for now we use the absolute path.
@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';

// Font Awesome
@import "fontawesome";

// Your custom LESS stylesheets goes here
//
// Since bootstrap was imported above you have access to its mixins which
// you may use and inherit here
//
// If you'd like to override bootstrap's own variables, you can do so here as well
// See http://twitter.github.com/bootstrap/less.html for their names and documentation
//
// Example:
// @linkColor: #ff0000;

@successBackground: white;
@successText: @green;
@errorBackground: white;
@errorText: @red;

@navbarHeight: 60px;

.alert-success, .alert-error {
    border: 10px solid @green;
    padding: 2%;
    font-size: 125%;
    line-height: 150%;
}

.alert-success { 
    border-color: @green;
}

.alert-error {
    border-color: @red;
}

Answer 1:

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

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

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

或更新您的Twitter的引导通过运行安装rails g bootstrap:install -f



Answer 2:

这也发生在我身上。 当您更新引导宝石则必须更新它的JavaScript和CSS。 要做到这一点,运行以下命令:

rails g bootstrap:install -f

这将行添加到您的应用程序/资产/ CSS / bootstrap_overrides.css.less文件,该文件是这样的:

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

这将解决这一问题。



Answer 3:

也许你忘记安装引导,你可以试试下面的命令。

rails g bootstrap:install


文章来源: variable @fontAwesomeEotPath_iefix is undefined