【问题标题】:compass: No such framework: "foundation"指南针:没有这样的框架:“基础”
【发布时间】:2013-09-04 16:29:31
【问题描述】:

我正在尝试使用安装 zurbs 基础框架

我已经安装了这个 gem: zurb-基础(4.3.1)

从我的项目中,我做到了:

 compass install foundation

我明白了:

No such framework: "foundation"

实际如何使用已安装的框架?

【问题讨论】:

    标签: sass zurb-foundation compass-sass


    【解决方案1】:

    命令是:

    compass install -r zurb-foundation foundation
    

    如果您已经安装了 zurb-foundation,那么使用基础创建新项目的命令是:

    compass create <project-name> -r zurb-foundation --using foundation
    

    如果您正在使用 Foundation 和 sass 处理已经存在的项目,则需要根目录中的 config.rb 文件:

    require 'zurb-foundation'
    # Require any additional compass plugins here.
    
    # 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
    
    
    # If you prefer the indented syntax, you might want to regenerate this
    # project again passing --syntax sass, or you can uncomment this:
    # preferred_syntax = :sass
    # and then run:
    # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
    preferred_syntax = :scss
    

    确保您在顶部有require 'zurb-foundation'。当我有一个已经存在的项目时,这就是为我解决的问题。

    【讨论】:

    • 我和 Susy 有同样的问题。通过compass:Gem::LoadError on line ["2064"] of c: Unable to activate susy-2.1.2, because sas s-3.2.19 conflicts with sass (~&gt; 3.3.0) Run with --trace to see the full backtrace 安装 susy 时出现此错误
    【解决方案2】:

    以下命令应该会有所帮助,文档here 中也有说明。

    在“创建您的第一个项目”下找到。

    $ compass create <project-name> -r zurb-foundation --using foundation
    

    我应该注意这是创建一个新项目

    如果它正在添加到现有项目中,也许你错过了:

    • 将 require "zurb-foundation" 添加到您的 config.rb 文件中

    【讨论】:

    • 我确实在使用一个已经存在的项目。该项目本身没有 ruby​​ 依赖项。我只是使用指南针来获取 sass 文件。所以,我没有 config.rb 文件。在这种情况下,是否还可以使用 sass 包?
    • 你确实需要一个 config.rb,否则 Compass 不知道库在哪里。
    • 是的,正如 cimmanon 提到的,您确实需要一个 config.rb 文件。你可以运行:“compass config” 这将只生成配置目录和 config.rb。然后编辑 config.rb 文件以链接现有项目上的正确路径。
    猜你喜欢
    • 2014-07-29
    • 1970-01-01
    • 2013-04-12
    • 1970-01-01
    • 2014-04-13
    • 2014-04-22
    • 2014-02-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多