seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 997 forks source link

After update to 2.2.7 the "fontawesome"-import doesn't work anymore #588

Closed toadle closed 10 years ago

toadle commented 11 years ago

I don't know why. I rolled back to 2.2.6 and it started working again.

olvap commented 11 years ago

im not having this isue, could you copy your bootstrap_and_overrides.css.less file, or what ever, where are you importing fontawesome?

toadle commented 11 years ago

We do this in our bootstrap_and_overrides.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"); @fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot#iefix"); @fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff"); @fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf"); @fontAwesomeSvgPath: asset-path("fontawesome-webfont.svg");

// Font Awesome @import "fontawesome";

toadle commented 11 years ago

Ah, I just noticed that all other imports are given with the extension ".less". Is that mandatory since 2.2.7 somehow? Or is that because of some other GEM we might have updated?

geoffharcourt commented 11 years ago

The path to fontawesome was changed, the fonts are now in a fontawesome subfolder. This should have been in a minor or major version update, not a patch version update, as it is not backwards-compatible.

The solution: add fontawesome/ before all your font paths so look in the fontawesome folder.

The new generator does this:

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

Where the old one did this:

// Font Awesome
@import "fontawesome";

While this project remains the best way to get Bootstrap into your rails project, the author has repeatedly refused to follow a versioning scheme that follows either Bootstrap's own version map or SemVer. My recommendation is to use pessimistic locking in your Gemfile so that you don't accidentally upgrade to a non-backwards-compatible version when you run bundle update.

tagliala commented 11 years ago

I do agree with @geoffharcourt: if there are breaking changes the major version number should be bumped up

I made the pull request containing the generator in the new version, I notified that there were breaking changes.

The path change is due to the fact that fontawesome is now splitted in several less files

The whole generator changed a lot.

Moreover, I suggest to not use asset-path anymore but asset-url to avoid issues in assets precompile as documented here: #571

toadkicker commented 11 years ago

@geoffharcourt We are moving to match Bootstrap's version numbers as we continue to release. I have been adding test coverage and asking people who submit PR's to include or help out with that so we can catch bugs like these earlier. @seyhunak usually merges into master and we fork/fix from there. :+1: pessimistic locking is ok in my book if you don't feel like fixing libraries in the course of the day.

toadle commented 11 years ago

@geoffharcourt Thx for pointin this out. Changed the paths, cleared our cache and bumped up the gem-version. That worked. This should really be done more careful or with a failover.

We'll be locking the gem-version from now on though.

tagliala commented 11 years ago

@toadkicker if you follow bootstrap's version numbers, you can't respect SemVer because of FontAwesome. In this case you have to use your own versioning system (like libv8's one - e.g.: 2.3.2.t - where t depends on FA and bugfixes).

The problem discussed here arised because of FontAwesome (main asset structure change), not Bootstrap... So you will have the same issues when FA will release a major.

FA 4 will have breaking changes and it will probably be released after Bootstrap 3.0. So let's say you have twitter-bootstrap-rails 3.0.0. In any case, if you want to integrate FA 4.0, there will be breaking changes and a major bump is still needed.

Sorry for my English, hope you can understand the point.

breakliu commented 11 years ago

I have this problem. I also 'rails g bootstrap:install' and 'rake assets:clobber assets:precompile'. But can't get this files(404): fontawesome-webfont.woff fontawesome-webfont.ttf fontawesome-webfont.svg

tagliala commented 11 years ago

@imlcl did u updated the generator as descibed here: #571 ?

breakliu commented 11 years ago

@tagliala I will try this tomorrow. I wanna know why twitter-bootstrap-rails gem not be fixed this problem...

tagliala commented 11 years ago

it's not a problem, it's explained in my above comments the reason of the change in the generator file.

The problem is the versioning scheme of twitter-bootstrap-rails (breaking changes from 2.2.6 to 2.2.7)

breakliu commented 11 years ago

@tagliala When I use 2.2.6 + Rails 3.2.13, that's working perfectly. But I can't fix the assets problem in Rails 4 without move the fontawesome-webfont.* to public/assets/. Here's my project files: Gemfile: https://gist.github.com/imlcl/5737410 Gemfile.lock: https://gist.github.com/imlcl/5737415 production.rb: https://gist.github.com/imlcl/5737416 bootstrap_and_overrides.css: https://gist.github.com/imlcl/5737422

Could you help me?

breakliu commented 11 years ago

fk, I fix it. add 'config.assets.compress = true' to production.rb -.-!!! @tagliala Thank you very much:)

nozpheratu commented 11 years ago

I'm running into 'fontawesome.less' wasn't found. with both the new & old paths on v 2.2.7.

Downgrading to 2.2.6 resolved it, sadly no new icons D:

tagliala commented 11 years ago

@12eebok

can you please update your generator according to latest changes

// 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";

If you still having problems, can you please try the master branch (using the above generator)?

gem 'twitter-bootstrap-rails', github: 'seyhunak/twitter-bootstrap-rails'
dennismonsewicz commented 11 years ago

The issue I am getting in Internet Explorer are:

CSS3117: @font-face failed cross-origin request. Resource access is restricted.
fontawesome-webfont.eot#iefix
CSS3117: @font-face failed cross-origin request. Resource access is restricted.
fontawesome-webfont.woff
CSS3117: @font-face failed cross-origin request. Resource access is restricted.
fontawesome-webfont.ttf

Any way to fix this?

toadkicker commented 10 years ago

Fixed in 2.2.8