Ankit Pandey Ankit Pandey - 3 years ago 233
Sass (Sass) Question

Showing Sass::SyntaxError when using bootstrap 3.3.0 in rails

I am using bootstrap 3.3.0 in my rails app but is showing below error

Error compiling asset application.css: Sass::SyntaxError: Undefined mixin 'hide-text'.
(in ../app/assets/stylesheets/application.css.scss)
Served asset /application.css - 500 Internal Server Error

Here is my application.css.scss

@import "bootstrap";
@import "bootstrap-timepicker";
@import "bootstrap-datepicker";

@import "globals/functions";
@import "globals/mixins";
@import "globals/variables";

/*@import "base";
@import "layout";*/
@import "style";
@import "vistyle";
@import "framework_and_overrides";

@import "modules/events";
@import "modules/gallery";
@import "modules/forms";

Sass::SyntaxError: Undefined mixin 'hide-text'.

hide-text is written in modules/events.css.scss file.

Its working fine with bootstrap '' but not for bootstrap '3.3.0' .

Answer Source

It may have something to do with the version of Rails you are using. You have not specified it, but I'll assume it is Rails 3.2 (as I've had the same issue with it.) I also assume that you have the gem in the 'assets' group. If that's the case your app looks very similar to the one I've had the same issue with.

Basically this is because by default in Rails 3.2, assets group gems are not required in production.

For details, see the updated docs in the bootstrap-sass README:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download