Ankit Pandey Ankit Pandey - 2 months ago 39
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 '2.3.1.0' but not for bootstrap '3.3.0' .

Answer

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: https://github.com/twbs/bootstrap-sass/commit/1a4ff080af2be55f1c17b5d2c99eb5f31aaf2e97