16
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

何気なくbundle updateしたら、

'fontawesome.less' wasn't found.

なんてエラーが…
グーグル先生に聞いてみると、ぴったりな議論を発見。

[GitHub After update to 2.2.7 the "fontawesome"-import doesn't work anymore](https://github.com/seyhunak/twitter-bootstrap-rails/issues/588 "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";
16
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?