未定义的混入 'media-breakpoint-only'

Undefined mixin 'media-breakpoint-only'

我正在尝试开始一些 bootstrap4/sass 编码。

我认为我已完成配置 environment/project 设置所需的一切:

使用

ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]

在已安装的 gem 中(之前尝试了一些 bootstrap 3):

autoprefixer-rails (6.3.6.2)
bootstrap (4.0.0.alpha4, 4.0.0.alpha3)
bootstrap-sass (3.3.7, 3.3.6)
breakpoint (2.7.0)
compass (1.0.3)
compass-core (1.0.3)
compass-import-once (1.0.5)
sass (3.4.22)
sass-globbing (1.1.5, 1.1.0.pre.0)
sassy-buttons (0.2.6)
sassy-maps (0.4.0)

在styles.scss中:

@import "compass/css3";
@import 'variables/.';
@import "bootstrap";

在config.rb中:

require 'compass/import-once/activate'
require 'bootstrap'
require 'sass-globbing'
require 'breakpoint'

但我的指南针正在工作并产生 styles.css:

/* line 18, c:/Ruby23/lib/ruby/gems/2.3.0/gems/bootstrap-4.0.0.alpha4/assets
/stylesheets/bootstrap/_normalize.scss */
body {
  margin: 0;
}

直到使用了一些 bootstrap 混入:

Error: Undefined mixin 'media-breakpoint-only'.

我错过了什么?

我认为您拥有所需的一切,但顺序错误。 compass(?) 需要 mixin media-breakpoint-only (a bootstrap sass function/mixin) 才能工作。因此,您必须更改顺序。顺序(我认为)应该是这样的:

  1. 需要断点
  2. 需要bootstrap
  3. 需要罗盘

同理styles.scss,bootstrap应该在罗盘之前。如果这不起作用,请尝试另一个订单。让我知道。