2014-09-06 2 views
0

J'essaie d'utiliser Compass pour un projet mais cela me donne envie de m'arracher les cheveux. Lorsque je compile mon SCSS, j'obtiens l'erreur this.Compilation avec boussole - Fichier à importer introuvable ou illisible

Le CSS complet, il compile est la suivante:

/* 
Error: File to import not found or unreadable: partials/reset. 
    Load paths: 
    Compass::SpriteImporter 
    C:/Users/Tom.PC/lp/sass 
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-core-1.0.1/stylesheets 
    on line 2 of C:/Users/Tom.PC/lp/sass/main.scss 

1: @import 'compass'; 
2: @import 'partials/reset'; 
3: @import '/partials/fonts'; 
4: @import '/partials/mediaqueries'; 
5:  
6: body { 
7:  font-family: mouse-deco, sans-serif; 

Backtrace: 
C:/Users/Tom.PC/lp/sass/main.scss:2 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/import_node.rb:66:in  `rescue in import' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/import_node.rb:45:in `import' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/import_node.rb:28:in `imported_file' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/import_node.rb:37:in `css_import?' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:294:in `visit_import' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/base.rb:36:in `visit' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:152:in `block in visit' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/stack.rb:79:in `block in with_base' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/stack.rb:115:in `with_frame' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/stack.rb:79:in `with_base' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:152:in `visit' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/base.rb:52:in `block in visit_children' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/base.rb:52:in `map' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/base.rb:52:in `visit_children' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:161:in `block in visit_children' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:173:in `with_environment' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:160:in `visit_children' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/base.rb:36:in `block in visit' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:180:in `visit_root' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/base.rb:36:in `visit' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:151:in `visit' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/visitors/perform.rb:8:in `visit' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/root_node.rb:36:in `css_tree' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/tree/root_node.rb:20:in `render' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/engine.rb:268:in `render' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-import-once-1.0.5/lib/compass/import-once/engine.rb:17:in `block in render' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-import-once-1.0.5/lib/compass/import-once/engine.rb:29:in `with_import_scope' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-import-once-1.0.5/lib/compass/import-once/engine.rb:16:in `render' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/plugin/compiler.rb:486:in `update_stylesheet' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/plugin/compiler.rb:214:in `block in update_stylesheets' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/plugin/compiler.rb:208:in `each' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/plugin/compiler.rb:208:in `update_stylesheets' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.4.0/lib/sass/plugin/compiler.rb:291:in `watch' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/lib/compass/sass_compiler.rb:46:in `watch!' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/lib/compass/commands/watch_project.rb:41:in `perform' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/lib/compass/commands/base.rb:18:in `execute' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/lib/compass/commands/project_base.rb:19:in `execute' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/lib/compass/exec/sub_command_ui.rb:43:in `perform!' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/lib/compass/exec/sub_command_ui.rb:15:in `run!' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/bin/compass:30:in `block in <top (required)>' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/bin/compass:44:in `call' 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-1.0.1/bin/compass:44:in `<top (required)>' 
C:/Ruby200-x64/bin/compass:23:in `load' 
C:/Ruby200-x64/bin/compass:23:in `<main>' 
*/ 
body:before { 
    white-space: pre; 
    font-family: monospace; 
    content: "Error: File to import not found or unreadable: partials/reset.\A  Load paths:\A   Compass::SpriteImporter\A   C:/Users/Tom.PC/lp/sass\A   C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-core-1.0.1/stylesheets\A   on line 2 of C:/Users/Tom.PC/lp/sass/main.scss\A \A 1: @import 'compass';\A 2: @import 'partials/reset';\A 3: @import '/partials/fonts';\A 4: @import '/partials/mediaqueries';\A 5:  \A 6: body {\A 7:  font-family: mouse-deco, sans-serif;"; } 

J'espère que c'est une solution facile, mais je me bats pour voir ce que l'erreur est. Est-ce la gemme elle-même ou est-elle causée par mon code SCSS?

+0

Est-ce que le chemin de votre partials ressembler à ceci: 'C: /Users/Tom.PC/lp/sass/partials/_reset. scss'? – cimmanon

+0

Ouais, c'est le chemin du fichier. J'ai le dossier de projet, et à l'intérieur j'ai le dossier de cache de sass, le dossier de CSS et le dossier de SASS qui a le dossier de partials à l'intérieur. – tomhughes

Répondre

0

Vous devriez essayer de changer

@import 'partials/reset'; 

dans

@import '/partials/reset'; 

comme il est déjà pour les autres fichiers du dossier-partials.
C'est seulement une supposition car il n'est pas clair où vous situez votre sass_dir, par exemple.

sass_dir = "sass" 

dans votre config.rb, mais vous pouvez juste essayer.

+0

Non, ne fonctionne pas avec le/en face de celui-ci. Si je supprime l'importation de réinitialisation, l'importation suivante génère une erreur. Il compile uniquement lorsqu'il n'y a pas d'importations. Sass dir est "sass" dans ma config. – tomhughes

+0

L'erreur a-t-elle changé? Il est possible que vous deviez maintenant ajuster tous les chemins pour commencer comme ../partials/ etc, au moins ils doivent commencer à partir de la même racine. Cela devrait simplement dépendre de votre configuration. –

+0

Le dossier Partials se trouve dans le dossier SCSS. Lorsque je déplace les fichiers que j'importe dans le même dossier que mon SCSS, les importations fonctionnent correctement, c'est-à-dire @import 'reset'; Suis-je juste un idiot et mettre le mauvais chemin de fichier? – tomhughes

-1

Vous devez ajouter l'option à votre compilateur SASS --compass comme --sourcemap=none et ira bien

+0

Si vous regardez l'image fournie, l'OP utilise la commande boussole. En outre, l'erreur indique que le répertoire de la boussole est en cours de recherche. – cimmanon

Questions connexes