decioferreira / bootstrap-generators

Bootstrap-generators provides Twitter Bootstrap generators for Rails
MIT License
353 stars 77 forks source link

Gem v3.1.1 - push to Heroku gives error 'File to import not found or unreadable: bootstrap.scss' #22

Closed jpwynn closed 10 years ago

jpwynn commented 10 years ago

I saw this same issue was raised 10 months ago, then resolved in an older version of the gem.

My rails 3.2.16 app uses bootstrap-generators (3.1.1) and sass-rails (3.2.6) (I tried them both in and not in assets group, got same error when pushing to heroku).

My config/application.rb has config.assets.initialize_on_precompile = false

My production.rb has config.assets.compile = true

Runs great locally, scaffolding works fine etc, but push to Heroku fails:

File to import not found or unreadable: bootstrap.scss.
       Load path: Sass::Rails::Importer(/tmp/build_ .... /app/assets/stylesheets/bootstrap-generators.scss)

I do not have a bootstrap_and_overrides stylesheet, just application.css.scss and bootstrap-generators.scss and bootstrap-variables.scss (which I also tried renaming to .css.scss just in case that was an issue)

I do not have an explicit copy of bootstrap.scss - I assume that is provided in the gem.

I originally used the gem v3.1.0, updating to gem v3.1.1 - still gives same error on Heroku.

fwiw, if I run locally: RAILS_ENV=production bundle exec rake assets:precompile I get the same error.

I also remvoed the bootstrap-generators gem from Gemfile, ran bundle install, replaces it, ran bundle install again, just to see if that fixed a bad install, but it had no effect.

Any thoughts?

jpwynn commented 10 years ago

Well after a few hours of debugging I think I found your bug ... it seems like the file your generate for bootstrap-generators.scss will work locally but NOT when pushing to Heroku:

@import "bootstrap-variables";
@import "bootstrap.scss";

But if you remove the .scss extension it DOES work on Heroku and also locally:

@import "bootstrap-variables";
@import "bootstrap";
jpwynn commented 10 years ago

HOWEVER... removing the .scss from @import "bootstrap.scss"; breaks glyphicons in development and in production. If I add it bacl, glyphicons work. If I remove the extension again, they break.

decioferreira commented 10 years ago

Just pushed a new version of the gem 3.1.1.1 - it should fix this issue. Also implemented new tests to verify this bug. Can you please tell me if this fixes your issue?

jpwynn commented 10 years ago

Sorry for the delay - somehow missed the github notification. Updated the gem in my bundle, was able to push to heroku and also see glyphicons on both production & dev. Have not tried scaffolding anything new but assume that is unaffected by your fix. You did really nice work on this very handy gem!

decioferreira commented 10 years ago

Thanks for the feedback :+1: