Skip to content

Sprockets::Rails::Helper::AssetFilteredError in Static#home #14730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Fudoshiki opened this issue Apr 13, 2014 · 6 comments
Closed

Sprockets::Rails::Helper::AssetFilteredError in Static#home #14730

Fudoshiki opened this issue Apr 13, 2014 · 6 comments

Comments

@Fudoshiki
Copy link
Contributor

Asset filtered out and will not be served: add Rails.application.config.assets.precompile += %w( static/home.css ) to config/initializers/assets.rb and restart your server

Showing /app/views/static/home.html.haml where line #4 raised:

Asset filtered out and will not be served: add Rails.application.config.assets.precompile += %w( static/home.css ) to config/initializers/assets.rb and restart your server

= content_for :content do
front page-home no-sidebars

  • content_for :head do
    = stylesheet_link_tag 'static/home', 'data-turbolinks-track' => true

latest rails 4.2.0 alpha from git

@rafaelfranca
Copy link
Member

Have you added Rails.application.config.assets.precompile += %w( static/home.css ) in the right file?

@GetContented
Copy link

I'm getting these error messages, too. Using this in my test.rb file:

  config.assets.compile = true
  config.assets.compress = false
  config.assets.debug = false
  config.assets.digest = false

The files it's complaining about are in my asset manifest. It's kinda annoying, also I don't really want it to precompile these files in dev & test, do I?

@GetContented
Copy link

After having this error, I realised that those lines would have fixed my issue, but I wasn't using the env I thought I was. Pardon me!

@rafaelfranca
Copy link
Member

@Fudoshiki could you provide a way to reproduce this issue or more information about it? If not I'll have to close it.

@buckspencer
Copy link

I had a very similar problem while doing the lynda.com rails 4 tutorial.

While I don't know if what I did was right, it did fix my problem.

I created an assets.rb file in config/initializers and pasted this line in the assets.rb file.
Rails.application.config.assets.precompile += %w( public.js )

The tutorial doesn't say anything about this problem and I was stumped for a while. I am also unsure as to why this fixed my problem. So if anyone has more information about this type error or why it was fixed this way it would be greatly appreciated.

@gitchrisadams
Copy link

Thanks buckspencer, that was very helpful. I would have banged my head against the wall much longer if I hadn't come across your post :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants