rails precompile assets see error in which file - css

I trying to precompile assets in production using
rake assets:precompile --trace RAILS_ENV=production
its says that there is syntax error like
Sass::SyntaxError: Invalid CSS after "white-space": expected ";", was
": nowrap;"
but there is no info that in which file.
is there anyway that I can see that about which file its talking about.

its assets / stylesheets/ application.scss file . just find white-space and you will get to the exact line.

Related

syntaxt error on rake asset precompile for production

I am trying to push my app to heroku,
When I am doing $ bundle exec rake assets:precompile RAILS_ENV=production RAILS_GROUPS=assets
I am getting
rake aborted!
Sass::SyntaxError: Invalid CSS after "...overflow:hidden": expected "{", was ";width:100%;hei..."
(sass):6888
Not able to figure out the exact issue here. Can someone help me out.
It seems like you're missing the semicolon after overflow:hidden, it would help if you pasted your actual SASS/SCSS file!

bower-rails font-awesome.css not found after resolve

I am using the rails-bower gem. https://github.com/rharriso/bower-rails
I installed font-awesome, my bowerfile looks like this
# A sample Bowerfile
# Check out https://github.com/42dev/bower-rails#ruby-dsl-configuration for more options
# asset 'bootstrap'
asset 'bootstrap-sass'
asset 'font-awesome'
asset 'jquery'
asset 'jquery-ujs'
asset 'nicescroll'
After doing a bower install my font-awesome works.
When pushing to heroku my stylesheets aren't loaded. This because I have to do a $ rake assets:precompile
The precompilation triggers a bower:resolve which causes the font-awesome.css to not be found anymore and my site quits working.
couldn't find file '/home/christoph/Documenten/kratos/vendor/assets/bower_components/font-awesome/css/font-awesome.css'
(in /home/christoph/Documenten/kratos/app/assets/stylesheets/application.css.scss:14)
The font-awesome.css file is located at that directory but it is named font-awesome.css.erb. How can I fix this so that the erb file is referenced when doing an asset precompilation.
This whole thing also blocks me pushing to heroku.

rake assets:precompile bug with rails and compass and "*"

I use rails 4.2.0 and compass-rails (2.0.2)
I have a css.scss file with
#import "compass/utilities/sprites";
#import "icons/*.png";
#include all-icons-sprites(true);
I have many image .png in app/assets/images/icons/XXX.png
I want deploy my app in production, it's work but with no assets, so I start
rake assets:precompile
in production environement.
An error occure:
rake aborted!
Sprockets::FileNotFound: couldn't find file 'icons/*.png'
I try to remove assets files in cache, nothing change.
details error: http://pastebin.com/6ggS3pP2
I think there is a problem with wildcard and path.
I try in dev ENV, nothing change...
I don't know what do more, what's the solution, plz?
to fix it, I just use mster branch of git like :
gem 'compass-rails', github: 'Compass/compass-rails'

Heroku/Zurb Foundation Sass SyntaxError in Rails App

My app is throwing this error when I try to push to Heroku. It looks like the culprit is a rogue !global line in a stylesheet somewhere, but I'm not sure where the source code lives.
rake aborted!
Sass::SyntaxError: Invalid CSS after "...odules, $name) ": expected "}", was "!global;"
(in /tmp/build_6cf14c02-e49b-44e7-819c-871d5da3cf73/app/assets/stylesheets/framework_and_overrides.css.scss:13)
Would greatly appreciate any help.
Change your foundation-rails gem from 5.4.4.0 to 5.4.3.1 in your gem file
gem 'foundation-rails', '5.4.3.1'
then run
bundle update
This should do it for now tell they fix it :)
Additionally:
As for finding the file "bundle show foundation-rails" use the finder "Go to folder" to the path and find "_function.scss" it is under vendor assets stylesheets foundation _function.scss
Both of my answers could be found in the link by gustavo-beathyate
As for heroku error
make sure if your adding any thing to the assets to use
rake assets:precompile RAILS_ENV=production
and then
also when you push use -f
git push -f heroku master
if not only use
git push -f heroku master
Here's a solution:
http://foundation.zurb.com/forum/posts/19222-sass-syntax-error-on-rails
You basically have to open the gem and modify line 13 in _functions.scss, removing the call to !global.
This issue has now been fixed with v5.4.5 of Foundation. See also here for some more background on the issue.
I was getting your exact error after I upgraded to foundation-rails 5.5.0.0. I updated the sass-rails gem per this post: https://stackoverflow.com/a/27807138/1753903 and the error went away.

Rails-Heroku-SASS Syntax Errors For File

My repo SelfFunderworks perfectly fine at my local machine. When I am deploying on Heroku, I observe the errors as shown below:
Error compiling CSS asset
Sass::SyntaxError: File to import not found or unreadable: homepage/key_points.
Load paths:
/app/app/assets/images
/app/app/assets/javascripts
/app/app/assets/stylesheets
/app/vendor/assets/javascripts
/app/vendor/assets/stylesheets
/app/vendor/bundle/ruby/2.0.0/gems/jquery-ui-rails-4.1.0/app/assets/images
/app/vendor/bundle/ruby/2.0.0/gems/jquery-ui-rails-4.1.0/app/assets/javascripts
/app/vendor/bundle/ruby/2.0.0/gems/jquery-ui-rails-4.1.0/app/assets/stylesheets
/app/vendor/bundle/ruby/2.0.0/gems/jquery-ui-rails-3.0.4/app/assets/javascripts
(in /app/app/assets/stylesheets/main.scss:3)
/app/app/assets/stylesheets/homepage.scss:3
I identified the path and observed that homepage/key_points is residing under the following path on my local machine:
/views/preorder/homepage/_key_points.html.erb
Upon modifying the contents of homepage.scss (as shown below), Heroku still throws up the same error.
#import "preorder/homepage/key_points";
Appreciate if someone can guide where I am going wrong?
I'm not sure what's your intention there, but you are trying to import a HTML file into a CSS file, which would produce broken CSS if it were successful.
And you can only import files for assets from certain locations (app/assets, lib/assets or vendor/assets).
In your case, the clue is on /app/app/assets/images. Notice the double app there. First, please follow the guide on setting up assets compilation for Rails 4 on Heroku.
You seem to be missing gem 'rails_12factor', group: :production on your Gemfile.
I got the issue fixed. I overlooked /assets/stylesheets/homepage directory. It had some .css.scss files which upon renaming to .scss fixed the issue.

Resources