maxim / bootswatch-rails

Bootswatches converted to SCSS ready to use in Rails asset pipeline.
MIT License
489 stars 84 forks source link

Precompilation issues #66

Closed chiefGui closed 9 years ago

chiefGui commented 10 years ago

This happens:

Sass::SyntaxError: Undefined variable: "$navbar-default-bg". (in /home/vagrant/local/ruby/gems/gems/bootswatch-rails-3.2.0/vendor/assets/stylesheets/bootswatch/amelia/_bootswatch.scss:16)

when I

rake assets:precompile


Why do am I getting this? Only happens on production.

esbanarango commented 10 years ago

@chiefGui Could you show how your application.css.scss or the file where you include bootswatch is defined, please.

chiefGui commented 10 years ago

There's no application.css.scss in my application. This is my coliseum.css.scss, the one which uses bootswatch:

@import 'common';
@import 'bootswatch/flatly/variables';
@import 'bootstrap';
@import 'bootswatch/flatly/bootswatch';

/**
 * my styles
 **/

But I don't think the problem is with this file at all – I already tried to remove the importation of bootswatch and the same error is still there.

esbanarango commented 10 years ago

@chiefGui Could you try again with the latest version v3.2.3.

kalashnikovisme commented 9 years ago

@chiefGui use v3.2.4 and I have such problem.

Rails 4.1.7, ruby 2.1.2

kalashnikovisme commented 9 years ago

To solve this problem you should add to bootswatch/#{style_name}/_bootswatch.scss

@import 'variables'

as a first line

but than I had many problems, like:

How fix this problem?

this mixins are not in gem directory. Where are they from?

westonganger commented 9 years ago

@kalashnikovisme did you end up fixing your issue? I would love to know how

westonganger commented 9 years ago

This could have something to do with this issue. https://github.com/twbs/bootstrap-sass/issues/863 It seems like bootstrap-sass is not loading the variables either.

westonganger commented 9 years ago

the problem actually lies in config/intializers/assets.rb or config/environments/production.rb

Rails.application.config.assets.precompile += %w( * )

You shouldnt precompile all, instead selectively precompile additional assets as needed

kalashnikovisme commented 9 years ago

@westonganger no. I didn't solve my problem permanently. I've removed bootswatch-rails gem and add bootswatch css-js files to my project.

chiefGui commented 9 years ago

Guys, I do not work with Rails/Bootswatch anymore. Feel free to close this issue when you want. Thank you so far!

zkmark commented 8 years ago

Si usas rails agregar al inicio de bootswatch.scss @import "bootstrap"; tu css de bootswatch

y en tu aplication.scss @import "variables"; @import "bootstrap"; @import "bootswatch";