Rails Assets precompile is too slow ~12hrs
ruby-on-rails, sass, twitter-bootstrap-3
Solution
I solved this problem:
The problem was the use of `@extend` sentence in my .scss files. This problem appear in this sass version.
I wanted more semantic html files(READ HERE for more information about it).
I found this problem making introspection into Sprockets precompile. With this great tutorial
The solution is take off all `@extend` sentences from my scss files and use plain bootstrap in my html.
Example: I had to change this.
# main.html
<div class='user-information'> ... </div>
# main.scss
.user-information {
@extend .col-md-12
}
by this:
# main.html
<div class='col-md-12'> ... </div>
Problem
I am local precompile assets like this RAILS_ENV=production bundle exec rake assets:precompile, but it's too slows 12hrs. I don't know what happen! and I don't know how to start to do something. Also when I make changes in some stylesheet files, these delay around 10s Please anyone can help me, thanks! This is my applications.css.scss ``` @import "_font-awesome"; @import "jquery.ui.core"; @import "jquery.ui.theme"; @import "dataTables/src/demo_table_jui"; @import "token-input-facebook"; @import "fullcalendar"; @import "fullcalendar.print"; @import "bootstrap"; @import "bootstrap-multiselect"; @import "bootstrap-datetimepicker"; @import "header"; @import "sub_header"; @import "students"; @import "people"; @import "institutions"; ``` My Gemfile: ``` gem 'sass-rails', '>= 3.2' gem 'bootstrap-sass', '~> 3.0.3.0' ``` its versions: ``` bootstrap-sass (3.0.3.0) sass (3.2.12) sass-rails (3.2.6) ``` Additional info: ``` rails 3.2.16 ruby 1.9.3 ``` UPDATE1 My complete Gemfile UPDATE2 When I put disable the assets compress `config.assets.compress = false`,in production mode, I get it results: ``` real 5m13.113s user 5m5.355s sys 0m5.268s ``` UPDATE3 got improvement but not a solution. - I change the css_compresor, now I'm using `:yui`. - I change `application.css.scss` in favor to use Sprockets require directives. Now this is my application.css.scss file. The time to precompile it's : ~24min