找不到要导入的文件或不可读的文件:指南针 [英] File to import not found or unreadable: compass

查看:65
本文介绍了找不到要导入的文件或不可读的文件:指南针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功安装了Sass,但是在导入Compass时遇到了麻烦。

I successfully installed Sass, but I'm having trouble importing Compass.

以下是错误的详细信息:

The following is the error detail:

*Syntax error: File to import not found or unreadable: compass.
              Load path: H:/HTML/___keoFull/sass
.....
Backtrace:
mainKeo.scss:2
style.scss:2
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/import_node.rb:67:in `rescue in import'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/import_node.rb:45:in `import'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/import_node.rb:28:in `imported_file'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/import_node.rb:37:in `css_import?'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:217:in `visit_import'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/base.rb:37:in `visit'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:100:in `visit'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:227:in `block in visit_import'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:227:in `map'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:227:in `visit_import'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/base.rb:37:in `visit'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:100:in `visit'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/base.rb:53:in `map'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/base.rb:53:in `visit_children'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:109:in `block in visit_children'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:121:in `with_environment'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:108:in `visit_children'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/base.rb:37:in `block in visit'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:128:in `visit_root'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/base.rb:37:in `visit'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:100:in `visit'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/visitors/perform.rb:7:in `visit'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/tree/root_node.rb:20:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/engine.rb:315:in `_render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/engine.rb:262:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/plugin/compiler.rb:341:in `update_stylesheet'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/plugin/compiler.rb:203:in `block in update_stylesheets'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/plugin/compiler.rb:201:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/plugin/compiler.rb:201:in `update_stylesheets'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/plugin/compiler.rb:235:in `watch'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/plugin.rb:107:in `method_missing'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/exec.rb:444:in `watch_or_update'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/exec.rb:307:in `process_result'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/exec.rb:41:in `parse'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/lib/sass/exec.rb:21:in `parse!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.2.6/bin/sass:9:in `<top (required)>'*


推荐答案

指南针调整局部输入的方式。

Compass adjusts the way partials are imported. It allows importing components based solely on their name, without specifying the path.

在您可以执行 @import'compass'之前,,您应该:

Before you can do @import 'compass';, you should:

将Compass安装为Ruby gem:

Install Compass as a Ruby gem:

gem install compass

之后,您应该使用Compass自己的命令行工具来编译您的SASS代码:

After that, you should use Compass's own command line tool to compile your SASS code:

cd path/to/your/project/
compass compile

请注意,指南针需要一个名为 config.rb 的配置文件。

Note that Compass reqiures a configuration file called config.rb. You should create it for Compass to work.

最小的 config.rb 可以像这样简单:

The minimal config.rb can be as simple as this:

css_dir =   "css"
sass_dir =  "sass"

并且您的SASS代码应位于 sass / 中。

And your SASS code should reside in sass/.

您可以使用 compass create< project-name> 创建一个空的Compass项目,而不是手动创建配置文件,然后复制您的SASS

Instead of creating a configuration file manually, you can create an empty Compass project with compass create <project-name> and then copy your SASS code inside it.

请注意,如果要使用Compass扩展程序,则必须:

Note that if you want to use Compass extensions, you will have to:


  1. config.rb 中获取它们;

  2. 从您的SASS文件中导入它们。

  1. require them from the config.rb;
  2. import them from your SASS file.

此处提供更多信息: http://compass-style.org / help /

这篇关于找不到要导入的文件或不可读的文件:指南针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆