0

I'm using bootstrap-sass gem in my Rails project with version 2.3.1.0. However, when pushed up to Heroku, I'm getting the Bootstrap 3 styles. I inspect the CSS style and it indeed does say Bootstrap version 3.

On local, the assignment seems to be correct. But equally perplexing, when I inspect the CSS file, it says Bootstrap version 3 despite displaying what looks like the Bootstrap 2.3 styles.

I think at one point, my bootstrap-sass gem was using the Bootstrap 3, but when I put it back to gem 'bootstrap-sass', '2.3.1.0', I'm getting this strange conflict. I really just want my Heroku app to display the styles correctly. Even though I'm pushing up my current local version to Heroku, it is still using Bootstrap 3 stylings.

Here's what I've got:

Gemfile:

group :assets do
    gem 'sass-rails',   '~> 3.2.3'
    gem 'coffee-rails', '~> 3.2.1'
    gem 'uglifier', '>= 1.0.3'
    gem 'bootstrap-sass', '2.3.1.0'
end

I've created a styles.css.scss file, where I have the line @import "bootstrap";Here's what it looks like on localhost:

enter image description here

Here's what it looks like on Heroku:

enter image description here

ekremkaraca
  • 1,453
  • 2
  • 18
  • 37
Jared Rader
  • 850
  • 6
  • 21

2 Answers2

0

It sounds like your Gemfile.lock might be incorrect. Have you verified that the correct version of the bootstrap gem is defined in Gemfile.lock?

Also might be worth just checking nothing is set in the Heroku env variable BUNDLE_WITHOUT. See the Heroku gem docs.

CDub
  • 13,146
  • 4
  • 51
  • 68
  • 1
    Hum... the version in gemfile.lock was correct. But I followed [this answer](http://stackoverflow.com/questions/11092664/getting-bootstrap-sass-bootstrap-css-into-production-on-heroku) and it eventually worked for me. – Jared Rader Nov 08 '13 at 15:53
  • Cool! Go ahead and post that as your answer and accept it as you solved it! :) – CDub Nov 08 '13 at 15:54
0

Not sure why this worked, but I found the second answer here to work for me.

I added *= require bootstrap" right above " *= require_tree . in application.css.

Then ran "bundle install --without production", followed by "rake assets:precompile". Committed the changes to git and then pushed to heroku.

I've never had to specifically require bootstrap in the asset pipeline before, but it works!

Community
  • 1
  • 1
Jared Rader
  • 850
  • 6
  • 21