【问题标题】:Sass Breakpoint causing Grunt errorSass 断点导致 Grunt 错误
【发布时间】:2017-06-19 04:49:34
【问题描述】:

刚刚使用 Mavericks 在我的 MacBook 上进行了全新安装。我正在使用 Yeoman 和 grunt 来编译我的项目。重新安装并从 repo 中下载代码后,我看到此错误:

Warning: LoadError on line ["55"] of /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb: 
cannot load such file -- app/bower_components/compass-breakpoint/lib/breakpoint

Run with --trace to see the full backtrace Use --force to continue.

我需要在我的 gruntfile.js 中设置断点。如果我删除了要求,一切都会按预期编译,没有错误。

如果我可以提供更多详细信息,请告诉我。谢谢

【问题讨论】:

标签: sass breakpoint-sass


【解决方案1】:

所以错误似乎是由于您没有指向正确的文件(这就是cannot load such file 错误的含义),所以请仔细检查您的导入路径是否正确,但目前,您必须 通过 Ruby Compass 使用 Breakpoint,因为它需要一些 Ruby 代码才能正常运行。随着 Sass 3.3 的推出,这个 Ruby 依赖关系消失了 Breakpoint 得到了更新,但它需要一个与 Sass 3.3 兼容的编译器(例如,libsass,grunt-sass 的强大功能,与 Sass 3.3 不兼容)。

我鼓励你使用grunt-contrib-compass,使用Bundler 来管理Ruby 版本依赖,并通过Ruby Compass 进行编译。这些步骤应该可以解决您的问题。

【讨论】:

  • 出色解决了我的问题,谢谢。我认为出于某种原因我需要同时安装 gem 和 bower 包。
  • @Snugug 如果我想删除指南针完整性而不使用它怎么办。有没有其他方法可以让它与 grunt 一起工作?
  • Breakpoint 可通过 Bower 进行任何安装,并可作为 Eyeglass 模块与 Node Sass 和 Eyeglass 一起使用
【解决方案2】:

建议使用 NPM 断点。安装:

npm install breakpoint-sass 并在你的 config.rb 文件中添加 require 'breakpoint'。

【讨论】:

    猜你喜欢
    • 2014-07-25
    • 2015-03-23
    • 1970-01-01
    • 1970-01-01
    • 2013-12-18
    • 1970-01-01
    • 2015-05-18
    • 2017-12-26
    • 2016-10-29
    相关资源
    最近更新 更多