ruby - precompile assets - rails 4.1.1 -


i'm setting first ruby site in production, works ok, when run

rake assets:precompile 

it adds css/js in "public/assets/" directory ok, have paths , line numbers in files? wondering how on 1 line , without line numbers/comments? have missed setting or this? here example of how application-428d86248ca363.css comes out:

/* line 1, /home/joe/myapp/app/assets/stylesheets/main.scss */ body {   background: #ccc; }  /* line 6, /home/joe/myapp/app/assets/stylesheets/main.scss */ #head {   background: #666; } /* line 4, /home/joe/myapp/app/assets/stylesheets/welcome.css.scss */ .block {   color: #1e1e1e; } /*  * manifest file that'll compiled application.css, include files  * listed below.  *  * css , scss file within directory, lib/assets/stylesheets, vendor/assets/stylesheets,  * or vendor/assets/stylesheets of plugins, if any, can referenced here using relative path.  *  * you're free add application-wide styles file , they'll appear @ bottom of  * compiled file styles add here take precedence on styles defined in styles  * defined in other css/scss files in directory. better create new  * file per style scope.  *  */ 

also can see includes big comment @ end. how go on 1 line no comments?

scss

they have paths , line numbers in files

that's problem scss should resolve if use rake assets:precompile rails_env=production


fix

whilst looking reference, found this answer , this github:

just update previous answer, chase t.  me not working anymore.       #config/compass.rb      line_comments = false  should become       line_comments = 0 

considering resource uses compass.rb, looked see how in standard rails app. found way use system, , looks can use command:

#config/application.rb config.sass.line_comments = false 

this confirmed this information:

using rails 4.1 , after looking , looking (and possibly misreading documentation) got work adding following /config/environments/development.rd & production.rb

config.sass.preferred_syntax = :scss

config.sass.style = :compact

config.sass.line_comments = false

style can set :nested, :expanded, :compact, :compressed. can see different options here: http://sass-lang.com/documentation/file.sass_reference.html#output_style

also, make sure restart server see compiled version change

hope helps someone.


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -