Rails Asset Pipeline: Invalid CSS

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



Leave a reply



Submit