bokmann / font-awesome-rails

the font-awesome font bundled as an asset for the rails asset pipeline
http://fortawesome.github.com/Font-Awesome/
MIT License
1.86k stars 244 forks source link

SASS 3.4.17 breaks font-awesome-rails in production (precompiled assets) #149

Closed superbilk closed 9 years ago

superbilk commented 9 years ago

tl;dr sass 3.4.17 breaks font-awesome-rails, pin your version to 3.4.16 and you are fine.

Hi erveyone,

I'm working on this, since I upgraded from font-awesome-rails 4.3.0 to 4.4.0 earlier that day. (see more at the end)

In production with precompiled assets (through capistrano) I only get empty boxes instead of icons. I have the issue in production right now (https://www.happinessmetric.com -> you should see some icons in the navbar)

If I precompile my assets on my local machine (RAILS_ENV=production bin/rake assets:precompile) I can reproduce the problem (all caches cleared). No matter if I start rails s in development or production mode. And I also tried different settings on config.assets.digest and config.assets.compile.

If I use the pipeline in development, everything is fine. That's my only working 'solution' at the moment.

Precompiled I get the correct filenames

fontawesome-webfont-1b7f3de49d68b01f415574ebb82e6110a1d09cda2071ad8451bdb5124131a292.ttf
fontawesome-webfont-3c4a1bb7ce3234407184f0d80cc4dec075e4ad616b44dcc5778e1cfb1bc24019.woff2
fontawesome-webfont-7414288c272f6cc10304aa18e89bf24fb30f40afd644623f425c2c3d71fbe06a.svg
fontawesome-webfont-a7c7e4930090e038a280fd61d88f0dc03dad4aeaedbd8c9be3dd9aa4c3b6f8d1.woff
fontawesome-webfont-d4f5a99224154f2a808e42a441ddc9248ffe78b7a4083684ce159270b30b912a.eot

and these are referenced correctly in my application.css. There are no 404 or any other errors.

I would guess precompiling somehow breaks the font-files. But I have no idea how to further investigate... I've also put these files online, maybe someone knows how to check these: https://www.dropbox.com/sh/a7x8o5raietzbz8/AACg_slTHfsJmNFZleJdNMW9a?dl=0

What I also did (referencing your debugging guidelines)

happinessmetric git:(master) ✗ bundle list | grep 'rails\|awesome\|sass\|less'
  * autoprefixer-rails (5.2.1.2)
  * bootstrap-sass (3.3.5.1)
  * bootswatch-rails (3.3.5)
  * browser-timezone-rails (0.2.00)
  * capistrano-rails (1.1.3)
  * coffee-rails (4.1.0)
  * factory_girl_rails (4.5.0)
  * font-awesome-rails (4.4.0.0)
  * guard-rails (0.7.2)
  * jquery-cookie-rails (1.3.1.1)
  * jquery-rails (4.0.4)
  * jstz-rails (1.0.4.1 3c5d573)
  * rails (4.2.3)
  * rails-deprecated_sanitizer (1.0.3)
  * rails-dom-testing (1.0.7)
  * rails-html-sanitizer (1.0.2)
  * rails-i18n (4.0.4)
  * sass (3.4.17)
  * sass-rails (5.0.3)
  * sprockets-rails (2.3.2)

As I said, I upgraded font-awesome-rails. And there are some other gems updated. Maybe this also helps:

commit ca1be6978d698e119bce3b0cd5b0f038c291e3d9
Author: Chris Schmidt <chris@superbilk.org>
Date:   Sat Aug 22 13:07:47 2015 +0200

    updated gems

diff --git a/Gemfile.lock b/Gemfile.lock
index 1329f6f..eecc13c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -54,11 +54,11 @@ GEM
       thread_safe (~> 0.3, >= 0.3.4)
       tzinfo (~> 1.1)
     acts_as_votable (0.10.0)
-    arel (6.0.0)
-    ast (2.0.0)
-    astrolabe (1.3.0)
-      parser (>= 2.2.0.pre.3, < 3.0)
-    autoprefixer-rails (5.2.1)
+    arel (6.0.3)
+    ast (2.1.0)
+    astrolabe (1.3.1)
+      parser (~> 2.2)
+    autoprefixer-rails (5.2.1.2)
       execjs
       json
     bcrypt (3.1.10)
@@ -76,7 +76,7 @@ GEM
     business_time (0.7.4)
       activesupport (>= 3.1.0)
       tzinfo
-    cancancan (1.11.0)
+    cancancan (1.12.0)
     capistrano (3.4.0)
       i18n
       rake (>= 10.0.0)
@@ -106,7 +106,7 @@ GEM
     delayed_job_active_record (4.0.3)
       activerecord (>= 3.0, < 5.0)
       delayed_job (>= 3.0, < 4.1)
-    devise (3.5.1)
+    devise (3.5.2)
       bcrypt (~> 3.0)
       orm_adapter (~> 0.1)
       railties (>= 3.2.6, < 5)
@@ -116,37 +116,37 @@ GEM
     devise-async (0.10.1)
       devise (~> 3.2)
     devise-i18n (0.12.1)
-    devise_invitable (1.5.1)
+    devise_invitable (1.5.2)
       actionmailer (>= 3.2.6, < 5)
       devise (>= 3.2.0)
     erubis (2.7.0)
-    eventmachine (1.0.7)
-    execjs (2.5.2)
+    eventmachine (1.0.8)
+    execjs (2.6.0)
     factory_girl (4.5.0)
       activesupport (>= 3.0.0)
     factory_girl_rails (4.5.0)
       factory_girl (~> 4.5.0)
       railties (>= 3.0.0)
-    faker (1.4.3)
+    faker (1.5.0)
       i18n (~> 0.5)
-    ffi (1.9.9)
-    font-awesome-rails (4.3.0.0)
+    ffi (1.9.10)
+    font-awesome-rails (4.4.0.0)
       railties (>= 3.2, < 5.0)
     formatador (0.2.5)
-    globalid (0.3.5)
+    globalid (0.3.6)
       activesupport (>= 4.1.0)
-    gon (5.2.3)
-      actionpack (>= 2.3.0)
+    gon (6.0.1)
+      actionpack (>= 3.0)
       json
       multi_json
-      request_store (>= 1.0.5)
-    griddler (1.2.0)
+      request_store (>= 1.0)
+    griddler (1.2.1)
       htmlentities
       rails (>= 3.2.0)
     griddler-sendgrid (0.0.1)
       griddler
     growl (1.0.3)
-    guard (2.12.7)
+    guard (2.13.0)
       formatador (>= 0.2.4)
       listen (>= 2.7, <= 4.0)
       lumberjack (~> 1.0)
@@ -163,18 +163,18 @@ GEM
     guard-minitest (2.4.4)
       guard-compat (~> 1.2)
       minitest (>= 3.0)
-    guard-rails (0.7.1)
+    guard-rails (0.7.2)
       guard (~> 2.11)
       guard-compat (~> 1.0)
     guard-rubocop (1.2.0)
       guard (~> 2.0)
       rubocop (~> 0.20)
-    haml (4.0.6)
+    haml (4.0.7)
       tilt
-    htmlentities (4.3.3)
+    htmlentities (4.3.4)
     i18n (0.7.0)
     i18n_yaml_sorter (0.2.0)
-    jbuilder (2.3.0)
+    jbuilder (2.3.1)
       activesupport (>= 3.0.0, < 5)
       multi_json (~> 1.2)
     jquery-cookie-rails (1.3.1.1)
@@ -190,10 +190,10 @@ GEM
     kaminari (0.16.3)
       actionpack (>= 3.0.0)
       activesupport (>= 3.0.0)
-    listen (3.0.0)
+    listen (3.0.3)
       rb-fsevent (>= 0.9.3)
       rb-inotify (>= 0.9)
-    loofah (2.0.2)
+    loofah (2.0.3)
       nokogiri (>= 1.5.9)
     lumberjack (1.0.9)
     mail (2.6.3)
@@ -203,19 +203,19 @@ GEM
     method_source (0.8.2)
     mime-types (2.6.1)
     mini_portile (0.6.2)
-    minitest (5.7.0)
-    multi_json (1.11.1)
+    minitest (5.8.0)
+    multi_json (1.11.2)
     nenv (0.2.0)
     net-scp (1.2.1)
       net-ssh (>= 2.6.5)
     net-ssh (2.9.2)
     nokogiri (1.6.6.2)
       mini_portile (~> 0.6.0)
-    notiffany (0.0.6)
+    notiffany (0.0.7)
       nenv (~> 0.1)
       shellany (~> 0.0)
     orm_adapter (0.5.0)
-    parser (2.3.0.pre.2)
+    parser (2.2.2.6)
       ast (>= 1.1, < 3.0)
     powerpack (0.1.1)
     pry (0.10.1)
@@ -240,7 +240,7 @@ GEM
       sprockets-rails
     rails-deprecated_sanitizer (1.0.3)
       activesupport (>= 4.2.0.alpha)
-    rails-dom-testing (1.0.6)
+    rails-dom-testing (1.0.7)
       activesupport (>= 4.2.0.beta, < 5.0)
       nokogiri (~> 1.6.0)
       rails-deprecated_sanitizer (>= 1.0.1)
@@ -261,17 +261,17 @@ GEM
       ffi (>= 0.5.0)
     rb-readline (0.5.3)
     rdoc (4.2.0)
-    request_store (1.1.0)
+    request_store (1.2.0)
     responders (2.1.0)
       railties (>= 4.2.0, < 5)
-    rubocop (0.32.1)
+    rubocop (0.33.0)
       astrolabe (~> 1.3)
       parser (>= 2.2.2.5, < 3.0)
       powerpack (~> 0.1)
       rainbow (>= 1.99.1, < 3.0)
       ruby-progressbar (~> 1.4)
     ruby-progressbar (1.7.5)
-    sass (3.4.15)
+    sass (3.4.17)
     sass-rails (5.0.3)
       railties (>= 4.0.0, < 5.0)
       sass (~> 3.1)
@@ -288,13 +288,13 @@ GEM
     simple_form (3.1.0)
       actionpack (~> 4.0)
       activemodel (~> 4.0)
-    sitemap_generator (5.0.5)
+    sitemap_generator (5.1.0)
       builder
-    skylight (0.6.0)
+    skylight (0.8.0)
       activesupport (>= 3.0.0)
     slop (3.6.0)
     spring (1.3.6)
-    sprockets (3.2.0)
+    sprockets (3.3.3)
       rack (~> 1.0)
     sprockets-rails (2.3.2)
       actionpack (>= 3.0)

Cheers,

superbilk commented 9 years ago

As everyone might have expected, it's not a bug with font-awesome-rails. It's some other gem (still don't know wich broke everything). Sorry.

rmm5t commented 9 years ago

Just FYI. Bootswatch-rails packages a competing and outdated version of FontAwesome.

Not sure if that was your problem, but maybe worth investigating.

On Saturday, August 22, 2015, Chris notifications@github.com wrote:

As everyone might have expected, it's not a bug with font-awesome-rails. It's some other gem (still don't know wich broke everything). Sorry.

— Reply to this email directly or view it on GitHub https://github.com/bokmann/font-awesome-rails/issues/149#issuecomment-133769097 .

superbilk commented 9 years ago

Thanks. In my case ist was sass. It's working with 3.4.15 and 3.4.16 but not with 3.4.17 So I set the version to 3.4.16 and will wait.

Unfortunately I don't know enough about sass (or font-awesome) to see whats the problem here. https://github.com/sass/sass/blob/stable/doc-src/SASS_CHANGELOG.md

DannyBen commented 9 years ago

Hey @superbilk - thanks for this, don't be sorry - saved me a lot of time. Having the same issue - after upgrading FontAwesome and some other gems, it stopped working in production. The problem is indeed with sass - I am also locking it now at 3.4.16 and its working (was 3.4.17, broken).

Is this a FontAwesome issue or sass?

DannyBen commented 9 years ago

I think this ticket should be kept open until it is resolved, even if the solution needs to be done elsewhere - other people searching for it might not search in the "closed" tickets group.

superbilk commented 9 years ago

Thanks for opening an issue on sass, @DannyBen I'll reopen this and edit my first comment accordingly.

DannyBen commented 9 years ago

The friends at sass just released 3.4.18 which fixes this.

rmm5t commented 9 years ago

:+1: Thanks everyone for working through this with the Sass team and keeping us in the loop here.

@superbilk Please close this issue out once you're satisfied with the Sass fix.

superbilk commented 9 years ago

it's also fixed for me :-D thanks to the people at sass and @DannyBen

DannyBen commented 9 years ago

Cool