DaniG2k
DaniG2k

Reputation: 4903

Rails 4: Fontawesome causing AssetFilteredError

I have a really simple Fontawesome setup:

Gemfile:

gem 'font-awesome-rails'

applicaton.css:

/*
 *= require font-awesome
 *= require_tree .
 *= require_self
 */

When I start up my Rails server in development, I get the following error message:

Sprockets::Rails::Helper::AssetFilteredError in Home#index

Asset filtered out and will not be served: add `Rails.application.config.assets.precompile += %w( fontawesome-webfont.eot )` to `config/initializers/assets.rb` and restart your server
  (in ~/.rvm/gems/ruby-2.2.0/gems/font-awesome-rails-4.2.0.0/app/assets/stylesheets/font-awesome.css.erb)

The line causing this issue is, obviously, the one that imports Fontawesome:

application.html.erb:

<%= stylesheet_link_tag('application', media: 'all', 'data-turbolinks-track' => true) %>

I'm utterly confused as to how this is breaking now when it worked just a few days ago. I see that the last change to Fontawesome-rails on Github was about a month ago so I'm truly perplexed as to why this may not be working. Any ideas? Thanks!

Upvotes: 1

Views: 884

Answers (1)

Ryan McGeary
Ryan McGeary

Reputation: 240134

This was reported as an issue with the sprockets-rails gem:

https://github.com/rails/sprockets-rails/issues/217

sprockets-rails v2.2.4 fixes this.

Upvotes: 1

Related Questions