Bonjour,

D'habitude j'utilise Sass directement via mon ide (Netbeans) et dans ce cas là pas de problème.

Cependant je souhaite l'utiliser en ligne de commande lors d'un projet à réaliser pour ma LP.

Et quand je lance la commande :

D:\LP-CISIIE\HTML Avancé\Mini-FrameWork>sass --watch scss/framework.scss

Il me sort que j'ai un problème d'encodage. J'ai bien essayé d'utilisé la commande chcp 1252 mais toujours le même problème.

D:\LP-CISIIE\HTML Avancé\Mini-FrameWork>sass --watch scss/framework.scss
>>> Sass is watching for changes. Press Ctrl-C to stop.
Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and UTF-8
  Use --trace for backtrace.

Et en faisant un --trace

D:\LP-CISIIE\HTML Avancé\Mini-FrameWork>sass --watch scss/framework.scss --trace
>>> Sass is watching for changes. Press Ctrl-C to stop.
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/importers/filesystem.rb:87:in `index': incompatible character encodings: Windows-1252 and UTF-8 (Encoding::CompatibilityError)
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/importers/filesystem.rb:87:in `remove_root'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/importers/filesystem.rb:146:in `find_real_file'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/importers/filesystem.rb:32:in `mtime'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/staleness_checker.rb:134:in `mtime'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/staleness_checker.rb:163:in `block in dependency_updated?'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/staleness_checker.rb:81:in `call'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/staleness_checker.rb:81:in `stylesheet_modified_since?'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/staleness_checker.rb:69:in `stylesheet_needs_update?'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/compiler.rb:211:in `block in update_stylesheets'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/compiler.rb:209:in `each'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin/compiler.rb:293:in `watch'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/plugin.rb:108:in `method_missing'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/exec/sass_scss.rb:384:in `watch_or_update'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/exec/sass_scss.rb:51:in `process_result'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/exec/base.rb:52:in `parse'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/lib/sass/exec/base.rb:19:in `parse!'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sass-3.4.18/bin/sass:13:in `<top (required)>'
        from C:/Ruby22-x64/bin/sass:23:in `load'
        from C:/Ruby22-x64/bin/sass:23:in `<main>'

J'avoue que je seche un peu et apparement les réponses que je trouve sur le web ne résouent pas mon problème ...

Quelqu'un peut m'aider ?

En vous remerciant d'avance.

5 réponses


Bonjour.
As-tu regardé ceci : Ruby et Windows, problèmes récurrents ?

Morghoot
Auteur

Oui j'ai fais les manips de la première partie avec la commande chcp 1252.

Je viens de remarquer un truc, c'est que quand mon dossier scss est vide la commande marche, je peux créer des fichiers et ils sont compilés en css.

Mais quand je refait la commande plus tard dans le dossier qui du coup n'est plus vide il me sort toujours

D:\LP-CISIIE\HTML Avancé\Mini-FrameWork>sass --watch scss:css
>>> Sass is watching for changes. Press Ctrl-C to stop.
Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and UTF-8
  Use --trace for backtrace.
Morghoot
Auteur

Le problème vient du fait que j'ai un accent dans mon dossier, en le retirant le problème est résolu.

Il existe un moyen de pouvoir garder les accents dans mes dossiers ?

Tu peux essayer de forcer l'encodage UTF-8 de tes fichiers via notepad++ (menu encodage).

Alors il y a une autre solution qui n'a rien à voir avec les lignes de commande et qui fonctionne au poil : https://prepros.io/
Compatible linux, interface bien faite ( drag and drop et tout), compile du sass, scss, less et tout le reste.