rails asset pipeline: Invalid CSS
Try removing whitespaces below the line with text-transform: uppercase;
.
rake assets:precompile throws Sass::SyntaxError: Invalid CSS after */
SOLUTION
The file that was breaking things was the font awesome CSS. Removing that from application.css's "require" lines allowed the precompilation to work.
The way to do this was to first delete all of the precompilation require fields, showing that it would compile, and then to slowly add the require fields back to see where it broke.
(Thanks for all those who helped figure this out.)
Rails 4: Invalid CSS error during asset precompile in production mode
As I found the answer, I'm writing it here, wishing it to be useful for others.
To solve the DEPRECATION WARNING, check this link:
Asset pipeline DEPRECATION WARNING tsort.rb:226
And about the error, you should find which file causes the error exactly. The generated error and mentioned files in it are misleading.
You can work with your assets.rb
file to find which file (files) contains syntax error. Comment or remove all of the referred files in assets.rb
except one and redo asset precompile command in your production mode:
RAILS_ENV=production bundle exec rake assets:precompile
and repeat it for all css files to understand which one contains the error. This time the output of this command will be helpful and refer exactly to the problem. Then, it would be easy to find the error and fix it.
rake assets:precompile Sass::SyntaxError: Invalid CSS after padding: expected ;, was :20px;
It seems in the Rails 5 this error happening. I just ran rake assets:precompile
and it compiles successfully without error.
Rails 5 - Heroku: Precompiling assets failed (Sass::SyntaxError: Invalid CSS after ...lflings-regular: expected )
I've solved it after you drove my attention to bootstrap-mincer. I've changed
@import "bootstrap-mincer"; to
@import "bootstrap-sprockets"; line in my custom.css.scss file and now everything works. Thx...
Invalid css error when deploying to heroku and assets precompile
You appear to have a git merge conflict in your css file. Resolve the conflict, commit the changes, and try pushing again. Update: Just noticed that it is a *.orig file. Git mergetool will save a backup of the the file with the markers (like <<<<<<< HEAD etc) and append the suffix '.orig'. You should delete these before committing or if you want to keep them around for other reasons you should add *.orig to your .gitignore. See here for more information on strategies for handling mergetool backups.
Related Topics
How Md-Icons Are Rendered on Browser
Watermark Background Images in Div
Responsive Irregular Background Shape with CSS
If I Use .Container-Fluid in Bootstrap 3, Does That Mean I Need to Use Grid Classes
Childrens Selectors from Sibling Parent Divs Using CSS for Hover Effect
Ie Bug: Absolutely-Positioned Element with a Non-Transparent Background Colour
Hide Parts of Site on Mobile Devces
When Does a Box Establish an Inline Formatting Context
How to Center an Image Horizontally and Align It to The Bottom of The Container
†Appearing Instead of Quotation Marks
Media Query CSS and Notepad++ Compatibility Issue
HTML5 Footer - Margin That I Can't Remove
Wrap Bootstrap Navbar List Items Around Centered Brand Image
CSS Animation, Fadein/Fadeout 2 Images Continuously
When Using Grid 960, How to Still Have a 100% Width Header Section
Building a Grid Framework with Inline-Block's
CSS: Is It Correct That Text Content of a Div Overflows into The Padding