Compass watch and .sass-cache - ruby

(I added the line wp-content/themes/klasik-child/mysass/.sass-cache in the file .gitignore from) when I execute "Compass watch" I have this error:
Errno::ENOENT on line ["247"] of C: No such file or directory'
-C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\github2015\myproject\wp-content\themes\klasik-child\mysass\.sass-cache\75fcaf1b4852ceb732871195e41567cc2a7d8997
C%058C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\github2015
run with --trace to see the full backtrace
Yet 75fcaf1b4852ceb732871195e41567cc2a7d8997 and github2015 folder exists.
I reset my .gitingnore file and I tried to delete the folder ".sass-cache"
but I still have the same problem.
I tried adding sass_options = {:cache_location => "path\to\tmp\sass-cache"} in config.rb but it gives errors "mkdir" invalid argument - path
thank !
++ Other info :
1- Command is run here : C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\github2015\myproject\wp-content\themes\klasik-child\mysass
from windows command
2- directory structure
mysass
|---css
|----principal.css
|---images
|---sass
|----partials
|-----_accueil.scss
|----pricipal.scss
config.rb
3- config.rb
require 'compass/import-once/activate'
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
# sass_options = {:cache_location => "path\to\tmp\sass-cache"}
relative_assets = true
line_comments = false

I found the solution here: Compass/SASS - not all files are compiled
Indeed,
The problem exists only if I change _accueil.scss (PARTIALS).
When I change pricipal.scss no compilation problem.
When I change _accueil.scss of type I errors 'No such file or directory ...sass-cache/..' –
If I comment the first line of config.rb # require 'compass/import-once/activate' it is no more problem of compilation : all my stylesheets they are compiled normally.

I had the same issue it turns out my .sass-cache path was too long, and the file was silently failing and not being outputted to that directory. It never mentioned anywhere that my path was too long, I was trying a suggestion found here:
https://github.com/Compass/compass/issues/1791
To fix it,
Add this line to to your config.rb
cache_path = 'C:\temp\sass'

Related

Issues of app.scss compile error in sencha touch

In my windows machine, i installed java, sencha cmd, sencha doc, ruby, compass and i generated one sencha application in that i try to compile app.scss file using the compass compile command but it gives the following error in command prompt:
when i run compass compile command it deletes app.css file and gives following error.
C:\wamp\www\sass\resources\sass>compass compile modified config.rb
clean C:/wamp/www/sass/resources/css delete C:/wamp/www/sass/resources/css/app.css DEPRECATION WARNING on line 1,
column 7 of C:/Ruby22-x64/lib/ruby/gems/2.2.0/gem
s/compass-core-1.0.3/stylesheets/compass/css3/_shared.scss: Unescaped
multiline strings are deprecated and will be removed in a future versi
on of Sass. To include a newline in a string, use "\a" or "\a " as in
CSS.
WARNING: The compass/css3/shared module has been deprecated. You can
silence this warning by importing compass/css3/deprecated-support
instea d. Please be aware that module will be removed in the next
release.
on line 1 of C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/
stylesheets/compass/css3/_shared.scss
from line 3 of C:/wamp/www/sass/touch/resources/themes/stylesheets/senc
ha-touch/_base.scss
from line 22 of C:/wamp/www/sass/touch/resources/themes/stylesheets/sen
cha-touch/_default.scss
from line 4 of C:/wamp/www/sass/resources/sass/app.scss
DEPRECATION WARNING on line 87 of
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass
-core-1.0.3/stylesheets/compass/css3/_deprecated-support.scss: #{} interpolation near operators will be simplified in a future version
of Sass. To preserve the current behavior, use quotes:
unquote('"$moz-"#{$experimental-support-for-mozilla}
"$webkit-"#{$experimental
-support-for-webkit} "$opera-"#{$experimental-support-for-opera} "$microsoft-"#{ $experimental-support-for-microsoft}
"$khtml-"#{$experimental-support-for-khtml} ')
You can use the sass-convert command to automatically fix most cases.
DEPRECATION WARNING on line 92 of
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass
-core-1.0.3/stylesheets/compass/css3/_deprecated-support.scss: #{} interpolation near operators will be simplified in a future version
of Sass. To preserve the current behavior, use quotes:
unquote('"$ie6-"#{$legacy-support-for-ie6}
"$ie7-"#{$legacy-support-for-ie7} " $ie8-"#{$legacy-support-for-ie8}')
You can use the sass-convert command to automatically fix most cases.
WARNING: The compass/css3/box module is DEPRECATED and will be removed
in the ne xt release. Please use compass/css3/flexbox instead.
on line 4 of C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/
stylesheets/compass/css3/_box.scss
from line 4 of C:/wamp/www/sass/touch/resources/themes/stylesheets/senc
ha-touch/_base.scss
from line 22 of C:/wamp/www/sass/touch/resources/themes/stylesheets/sen
cha-touch/_default.scss
from line 4 of C:/wamp/www/sass/resources/sass/app.scss
error app.scss (Line 6 of C:/wamp/www/sass/touch/resources/themes/stylesheet
s/sencha-touch/_base.scss: File to import not found or unreadable:
blueprint/typ ography. Load paths: Compass::SpriteImporter
C:/wamp/www/sass/resources/sass
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets
C:/wamp/www/sass/touch/resources/themes/vendor/compass-recipes/stylesheets
C:/wamp/www/sass/touch/resources/themes/stylesheets) Sass::SyntaxError
on line ["6"] of C: File to import not found or unreadable: bl
ueprint/typography. Load paths: Compass::SpriteImporter
C:/wamp/www/sass/resources/sass
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets
C:/wamp/www/sass/touch/resources/themes/vendor/compass-recipes/stylesheets
C:/wamp/www/sass/touch/resources/themes/stylesheets Run with --trace
to see the full backtrace
C:\wamp\www\sass\resources\sass>
Here sass is my folder name in www folder.
my app.scss file is as following
// The following two lines import the default Sencha Touch theme. If you are building
// a new theme, remove them and the add your own CSS on top of the base CSS (which
// is already included in your app.json file).
#import 'sencha-touch/default';
#import 'sencha-touch/default/all';
// Custom code goes here..
// Examples of using the icon mixin:
// #include icon('user');
.abc
{
color: #fff;
}
my config.rb file is as following
# Get the directory that this configuration file exists in
dir = File.dirname(__FILE__)
# Load the sencha-touch framework automatically.
load File.join(dir, '..', '..', 'touch', 'resources', 'themes')
# Compass configurations
sass_path = dir
css_path = File.join(dir, "..", "css")
# Require any additional compass plugins here.
images_dir = File.join(dir, "..", "images")
output_style = :compressed
environment = :production
path of sencha sdk is as following
C:\wamp\www\sencha-touch-2.4.2-gpl\touch-2.4.2
Compass is included in the Sencha CMD installation. You can compile the CSS by executing the command sencha ant sass from your application folder.

Compile SASS files in separate folder with relative assets/urls?

I have my own Grunt/Compass/SASS project with a config.rb file that has these settings:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
add_import_path "./bower_components/slick-carousel/slick"
As you might guess, the problem here is the slick-carousel I am trying to compile together with my other sass-files. It works fine without that component. The slick-folder contains these files:
./ajax-loader.gif
./config.rb
./fonts
./fonts/slick.eot
./fonts/slick.svg
./fonts/slick.ttf
./fonts/slick.woff
./slick-theme.css
./slick-theme.scss
./slick.css
./slick.js
./slick.min.js
./slick.scss
When compiling the slick-theme.scss, I get warnings that it can not find the files which are referenced via relative urls.
WARNING: 'slick.woff' was not found (or cannot be read) in /project-root/fonts
Is there a way to tell the Compass/SASS compiler to use the "current" SASS file as base for the relative paths? So it would look in /project-root/bower_components/slick-carousel/slick/fonts instead?
Slick.js has it's own Sass variables for handling his fonts urls. So you have to properly assign the right path to that variable like this:
// Fonts
$slick-font-path: "./bower_components/slick-carousel/slick/fonts/";
You can check all slick's Sass variables here

Compass sprite path causing error

I've tried many responses already, but for some reason I can't get this to work. The error is:
No files were found in the load path matching "sprites/*.png"
My config.rb code:
relative_assets = true
cache=false
Encoding.default_external = "utf-8"
#########
# 1. Set this to the root of your project when deployed:
http_path = "/"
http_generated_images_path = "../images";
# 2. probably don't need to touch these
css_dir = "../css"
sass_dir = "./"
images_dir = "../images"
images_path = "../images"
javascripts_dir = "../js"
environment = :development
line_comments = true
My folder structure:
css
images
- sprites
scss (config.rb located in scss folder)
- partials
- - _mixins.scss (the file where the error is occuring)
And in mixins:
#import "sprites/*.png";
Any ideas what's wrong with the paths?
Thanks for any help.
First question is: do you actually have any files in your sprites folder? If yes, try adding this setting:
generated_images_path = "../images"
http_generated_images_path will be used to define what is the final path for the generated image, in the final (compiled) css, so maybe the setting above (without http_) is the one you need. My project structure is different but it works fine for me, I have more settings pointing to the same path though, this is what I have:
images_dir = "/assets/img"
generated_images_path = "assets/img"
http_images_dir = "assets/img"
http_images_path = "assets/img"
If just the first one doesn't solve the problem for you, try maybe adding all these?
Worst case change your project structure so you don't have to go up one level to get the folder (not saying that this is the problem as it shouldn't be but well, testing is the best way to find out)
I tried various options here. In the end I updated to Ruby 2.1.5 and turned off the Compass "save on build" plugin for Sublime, which seems to have fixed it. Not a perfect solution, but it works for now!

Disable line comments compass not working

I'm trying to disable line comments in my compass config.rb file but I still keep getting the line references to the scss file in my normal css file.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
I've restarted compass. Deleted my cache folder and my css file after saving my .scss. What am I doing wrong here?
My config.rb file was being ignored. Fixed it by going into the folder with commandline and typing compass watch from within the folder.
Still puzzles my because I have other projects in my WAMP folder and I just use compass watch [project] for those and the config.rb file for those does not get ignored.
Even with output style "compressed", I have not been able to remove multi-line comments, and the sass/scss documentation also suggests that they are not removed (only single-line comments with "//" are removed).
My solution was to simply apply a Perl one-liner to manually remove comments from a .css file, after sass has generated its final output:
sass -fCE utf-8 -t compressed application.sass application.css
perl -pi -e'BEGIN{$/=undef}s#/\*.*?\*/##gs' application.css
This worked for me
compass_config do |config|
config.sass_options = { :line_comments => false }
end

Stylesheets directory not added to load path for Compass extension

I'm trying to create a basic Compass extension, following the docs here:
http://compass-style.org/help/tutorials/extensions/
The problem I'm seeing is that I can't import files from my extension as expected, because the stylesheets directory, which the docs say will be automatically added onto the load path, isn't being added to the load path.
It gives me a command line error saying it can't find the file I tried to import, then lists out the load paths, verifying that my path is not on there.
One of the load paths is indeed /Users/myname/Sites/sitename/myextension_name, but I would expect there to also be /Users/myname/Sites/sitename/myextension_name/stylesheets
Anyone know why this wouldn't be happening as indicated in the docs?
UPDATE
Here's my config.rb as requested:
add_import_path '../../myextension'
# Require any additional compass plugins here.
require "susy"
require "sass-media_query_combiner"
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "../../js"
# You can select your preferred output style here (can be overridden via the command line):
output_style = :expanded #or :nested or :compact or :compressed
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
Ad hoc extensions need to be placed within the extensions_dir directory (which is set to extensions by default).
/path/to/config.rb
/path/to/sass/
/path/to/stylesheets/
/path/to/extensions/ <- extensions go here
Your myextension_name extension should live in /path/to/extensions/myextension_name/ and then follow the rest of the conventions for creating an extension. You may be able to assign extensions_dir to be the same as your sass_dir or your project's root, but I'm not sure that would be a wise idea.
If your extension is meant to be reused with other projects, it might be better to bundle it as a gem instead and use it the same way you're using Susy.

Resources