27

ブートストラップを使用して最初のプロジェクトに取り組んでいますが、プロジェクトを表示しようとするたびにこのエラーが発生します。私は周りを見回しましたが、同じ問題を抱えている人を見つけることができませんでした。どんな助けでも素晴らしいでしょう!前もって感謝します。


Less::Search#index の 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;
}
4

3 に答える 3

66

bootstrap_and_overrides.css.lessには、エラーが原因である変数がないことに注意してください。

次の行を他の@fontAwesome変数と一緒に追加すると、問題がないはずです。

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

または、を実行してTwitterブートストラップインストールを更新しますrails g bootstrap:install -f

于 2012-12-05T19:51:40.543 に答える
20

これは私にも起こりました。Bootstrap gem を更新したら、javascript と css を更新する必要があります。これを行うには、これを実行します。

rails g bootstrap:install -f

これにより、次のような行が app/assets/css/bootstrap_overrides.css.less ファイルに追加されます。

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

これで問題は解決します。

于 2012-12-13T05:29:57.740 に答える
3

ブートストラップのインストールを忘れている可能性があります。以下のコマンドを試すことができます。

rails g bootstrap:install
于 2012-12-08T01:23:21.210 に答える