Compass taking too long to compile - sass

Since updated to the latest version of Compass it now takes 4.294s to compile.
I need this version of compass due to needed susy
Running "sass:dist" (sass) task
Running "watch" task
Completed in 4.294s at Tue Sep 30 2014 23:38:01 GMT+0200 (W. Europe Daylight Time) - Waiting...`
// Running versions
compass -v 1.0.1
susy -v 2.1.3
sass -v 3.4.4
I compile with grunt:
sass: {
dist: {
options: {
style: 'compressed',
require: 'susy',
compass: true
},
files: {
'<%= yeoman.css %>/style.css': '<%= yeoman.sass %>/style.scss'
}
}
}
How can I speed up the compile time? Is it something wrong with my config?

It's not a config problem, it's a known performance regression in the latest Sass & Compass.

Having the same problem, pulling my hair out to find a solution but and finally found one; It is to downgrade.
From 2mins+ of compiling to 25s.
Here's How:
You need to install these (if your using OSX):
http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages
Install Bundle
gem install bundle
Make a Gemfile in your root folder, name it "Gemfile"
# frozen_string_literal: true
source "https://rubygems.org"
# gem "rails"
gem 'sass', "3.2.9"
gem 'sass-globbing', ">= 1.1.0"
gem 'compass', "0.12.2"
gem 'breakpoint', "2.0.5"
gem 'singularitygs', "< 2.0.0"
gem 'bootstrap-sass'
Install GemFile and update it
bundle install && bundle update
Then to run compass with bundle
time bundle exec compass compile <path>
I'm keeping my versions like these for a while, until they fix the performance issues. Hope it helps!

Related

Could not find a custom installed gem during runtime

On rhel8, I built and installed a custom gem test1.
$ gem build test1.gemspec
Successfully built RubyGem
Name: test1
Version: 0.0.1
File: test1-0.0.1.gem
$ gem install test1-0.0.1.gem
Successfully installed test1-0.0.1
1 gem installed
# check if gem is installed. All gems are installed in this path
$ gem which test1
/usr/local/share/gems/gems/test1-0.0.1/lib/test1.rb
Now in another custom gem I build, the gemspec file looks like this:
# in test2.gemspec file
Gem::Specification.new do |spec|
spec.name = "test2"
...
spec.add_runtime_dependency "test1", "0.0.1"
...
end
When I try to go install test2 gem it fails and says it could not find the test1 gem which is already installed. This problem started happening on rhel8. I tested on debian and alpine and it had no issues finding and installing the gem.
$ gem build test2.gemspec
Successfully built RubyGem
Name: test2
Version: 0.0.1
File: test2-0.0.1.gem
$ gem install test2-0.0.1.gem
ERROR: Could not find a valid gem 'test1' (= 0.0.1) in any repository
If I change to add_development_dependency, it builds and installs the gem. The image works as expected and has no issues. Does anyone know why its not able to find the gem when I add add_runtime_dependency?
If you are building a private gem that requires another private gem, you will need to define the dependency gem in both the gemspec and the Gemfile, while providing the actual source in the Gemfile.
For example, we are using GemFury to host private gems, and then in any other gem that needs this private gem, we do this:
# Gemfile
source 'https://gem.fury.io/your-user/' do
gem 'your-gem'
end
gemspec
# your-gem.gemspec
s.add_runtime_dependency 'your-gem', '0.0.1'

gulp-compass asking for Ruby and Compass in PATH when they are already there

I'm trying to get gulp-compass to work on my Debian linux but am getting an error message stating that Ruby and Compass must be in the path. I am a bit of a beginner when it comes to Gulp so is probably me being stupid.
The following is the exact error message I get when running the task I create in my Gulpfile:
events.js:85
throw er; // Unhandled 'error' event
^
Error: You need to have Ruby and Compass installed and in your system PATH for this task to work.
Process finished with exit code 1
I've looked through other similar questions that suggest doing a gem install compass and a gem install sass but neither seem to work for me.
My Gulpfile is as follows:
var gulp = require('gulp'),
compass = require('gulp-compass');
gulp.task('stylesheets', function(){
return gulp.src('**/*.scss')
.pipe(compass({
config_file: './config.rb',
css: 'css',
sass: 'sass'
}))
.pipe(gulp.dest('css'));
});
I can runruby -v and compass -v I can see that these are correctly in my path and doing an echo $PATH shows that ruby is definitely there.
I am wondering if it is a problem to do with me installing ruby with RVM or the fact that I am using Bundler to install the gems in my project. My Gemfile is as follows:
source 'https://rubygems.org'
gem 'susy'
gem 'compass'
gem 'breakpoint'
I have installed the gems with bundle install and have also tried the bundle_exec: true option in gulp-compass (though truth be told I don't really know what this is for not being a Bundler expert). I have tried re-installing Ruby.
Has anyone any idea as to why I am getting the above error message? I've never had errors like this when doing similar with Grunt.
I've finally managed to get round this. I uninstalled RVM with rvm implode and then installed Ruby again with a regular apt-get install ruby.
Once I did this it all worked fine. I had to make a minor tweak to my gulpfile so it is now:
var gulp = require('gulp'),
compass = require('gulp-compass');
gulp.task('stylesheets', function(){
console.log();
return gulp.src('sass/**/*.scss')
.pipe(compass({
config_file: './config.rb',
css: 'css',
sass: 'sass'
}))
.pipe(gulp.dest('css'));
});
This isn't exactly an ideal as I'm now stuck with an older version of Ruby (ruby 2.1.5p273) when the current stable release (at time of writing) is 2.2.2. I'd rather use RVM but this will do for now.

Sass builds/compiles very slowly (also using Compass) [duplicate]

Since updated to the latest version of Compass it now takes 4.294s to compile.
I need this version of compass due to needed susy
Running "sass:dist" (sass) task
Running "watch" task
Completed in 4.294s at Tue Sep 30 2014 23:38:01 GMT+0200 (W. Europe Daylight Time) - Waiting...`
// Running versions
compass -v 1.0.1
susy -v 2.1.3
sass -v 3.4.4
I compile with grunt:
sass: {
dist: {
options: {
style: 'compressed',
require: 'susy',
compass: true
},
files: {
'<%= yeoman.css %>/style.css': '<%= yeoman.sass %>/style.scss'
}
}
}
How can I speed up the compile time? Is it something wrong with my config?
It's not a config problem, it's a known performance regression in the latest Sass & Compass.
Having the same problem, pulling my hair out to find a solution but and finally found one; It is to downgrade.
From 2mins+ of compiling to 25s.
Here's How:
You need to install these (if your using OSX):
http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages
Install Bundle
gem install bundle
Make a Gemfile in your root folder, name it "Gemfile"
# frozen_string_literal: true
source "https://rubygems.org"
# gem "rails"
gem 'sass', "3.2.9"
gem 'sass-globbing', ">= 1.1.0"
gem 'compass', "0.12.2"
gem 'breakpoint', "2.0.5"
gem 'singularitygs', "< 2.0.0"
gem 'bootstrap-sass'
Install GemFile and update it
bundle install && bundle update
Then to run compass with bundle
time bundle exec compass compile <path>
I'm keeping my versions like these for a while, until they fix the performance issues. Hope it helps!

Load error with Susy - Sass - Compass - watch

I have compass 1.0.0.alpha.18 installed with Sass 3.3.2 and Susy 2.0.0 and get
"Loaderror on line["45"] of C: cannot load such file --wdm"
The process that I am trying in the console is this:
gem install sass
gem install compass
When I do this, it tells me "successfully installed compass-0.12.3 but if I run compass --version I get Compass 1.0.0.alpha.18.
gem install susy
compass watch [my sass folder]
Returns: Compass is watching for changes
overwrite ../css/styles.css
Loaderror on line["45"] of C: cannot load such file --wdm
Any help would be greatly appreciated.

How to: Coffeescript-Compiling in Aptana

I installed Aptana, and i want to try Coffeescript. When I try to "Compile and display JS" it won´t work - console shows:
....xyz.sh: line 3: coffee: command not found
....xyz.sh: line 3: pre: command not found
I don´t get it - how do i get it to run?
Thank you!
Edit:
Since yesterday I managed to get compass/sass running in Aptana (yeah!) - so i realized that my question might be wrong: Do i have to tell Aptana (Windows?) where to find the compiler?
Edit 2:
Realized: The problem is - how can this gem be installed (in Aptana if possible):
via https://github.com/netzpirat/guard-coffeescript
I get an error when installing the guard gem:
ERROR: Error installing guard:
The 'ffi' native gem requires installed build tools.
After trying some stuff here is a litte tutorial to setup compass and coffeescript for a project in Aptana:
(Info: I know very little about coding or ruby, so please be patient :) )
Create project ( i choose basic web template)
Terminal:
$ gem install compass
$ compass create myProject --using blueprint
check:
http://compass-style.org/reference/blueprint/
You also have to setup some other stuff:
I found this page and followed it through..
https://github.com/netzpirat/guard-coffeescript
Install bundle:
$ gem install bundle
$ bundle init //to create the gemfile
Install guard:
You need to install Ruby Devkit before - check this links:
http://rubyinstaller.org/downloads/
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
If you did so
$ gem install guard
$ gem install guard-coffeescript
I also installed a JS-Engine as recommended here:
https://github.com/netzpirat/guard-coffeescript#javascript-runtimes
$ gem install therubyrhino
For Coffeescript:
$ gem install coffee-script
$ gem install coffee-script-source
Then you have to edit the gemfile, mine looked like this:
# A sample Gemfile
source "https://rubygems.org"
# gem "rails"
group :development do
gem 'guard'
end
group :development do
gem 'guard-coffeescript'
end
group :development do
gem 'therubyrhino'
end
run bundle
$ bundle
create guardfile
$ guard init
edit the guardfile
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'coffeescript', :input => 'myProject/coffeescript', :output => 'myProject/javascript'
you can start the guard with
$ guard start
This worked for me! If you see any mistakes please let me know!

Resources