2013-07-25

twitter-bootstrap-rails v2.2.6 を v2.2.7にバージョンアップしたらFont Awesomeがエラーに…

何気なくbundle updateしたら、
'fontawesome.less' wasn't found.
なんてエラーが…
グーグル先生に聞いてみると、ぴったりな議論を発見。
GitHub After update to 2.2.7 the "fontawesome"-import doesn't work anymore

どうも、v2.2.7では設定内容が変わったらしくv2.2.6と互換性が無いとのこと。
設定は、
app/asset/stylesheets/bootstrap_and_overrides.css.less
を修正。
修正箇所は下の通り。

bootstrap_and_overrides.css.less
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
// Note: If you use asset_path() here, your compiled bootstrap_and_overrides.css will not
//       have the proper paths. So for now we use the absolute path.
@fontAwesomeEotPath: asset-path("fontawesome-webfont.eot?v=3.0.2");
@fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot?#iefix&v=3.0.2");
@fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff?v=3.0.2");
@fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf?v=3.0.2");

// Font Awesome
@import "fontawesome";

修正後はこんな感じに。
bootstrap_and_overrides.css.less
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot#iefix");
@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");

// Font Awesome
@import "fontawesome/font-awesome";

0 件のコメント:

コメントを投稿