normalize-rails
normalize-rails copied to clipboard
AssetNotPrecompiled error with index.css
I am working with normalize-rails 4.1.1 and rails 5.0.1.
When accessing a form in development (not tried in production), I have the error:
ActionView::Template::Error (Asset was not declared to be precompiled in production.
Add Rails.application.config.assets.precompile += %w( index.css ) to config/initializers/assets.rb and restart your server):
1: = form_for [@artifact, @resource] do |f|
2: - if @resource.errors.any?
3: #error_explanation
4: h2 = "#{pluralize(@resource.errors.count, "error")} prohibited this resource from being saved:"
After a long time, I found out that the only gem in my libs that had an index.css is normalize-rails. Removing the gem prevents the error. When doing what is recommended (adding index.css to the precompile array), when submitting the form I am brought to a "Method Not Allowed" page.
Is there a reason to have index.scss
in this gem at all?
I've had an error forever where requests to /assets/ cause a 500 error. Turns out it's because of this gem's index.scss, and removing the file from my fork of the gem doesn't seem to cause any issues. I'm wondering if this file is just a leftover from times gone by and could be removed.
The root index.scss
is a bit weird. I'm not sure how this could ever be referred to. I'm not sure how active this project is anymore. I'd be a bit wary about changing this without knowing why it was put there. Perhaps check the git history?