0

I've converted my Rails app to Rails 4. I'm using the Twitter Bootstrap Rails gem 2.2.6.

My application is working fine locally and in production. When I deploy everything looks fine. I'm not seeing any errors in my Heroku logs when browsing the site.

However, while my dev environment is displaying my color customizations properly, in production it's using the Bootstrap defaults.

I've tried recompiling my assets before each deployment using:

RAILS_ENV=production bundle exec rake assets:precompile

My application.css contains the usual:

 *= require_self
 *= require_tree .

My overrides are in bootstrap_and_overrides.css.less and look like this:

@navbarBackground: #4466af;
@navbarBackgroundHighlight: #4E7AC7;
@navbarText: @white;
@navbarLinkColor: @white;
@navbarLinkColorHover: #7FB2F0;

All of my other overrides are working correctly. It's just the navbar that's causing problems.

I've cleared my browser cache/history/etc. and that hasn't fixed it either.

Any ideas? I'm completely stumped.

Scott S.
  • 749
  • 1
  • 7
  • 26
  • Since you have cleared the browser cache: did you also check the color settings in the prod environment's css? – Ben Sep 06 '13 at 18:08
  • When I inspect the element in dev the colors are correct. In production they aren't. For example: bootstrap_and_overrides.css.less in dev shows background-color: #4a72bd. In production the compiled application.css shows background-color: #fafafa – Scott S. Sep 06 '13 at 20:32
  • Hmmm, seems to be an Heroku issue, which is somehow strange... personally, I use the bootstrap-sass gem which works fine on Heroku with overrides. If you try this, be sure to define the variable overrides in your custom.css.scss before the import bootstrap statement. – Ben Sep 06 '13 at 20:37

1 Answers1

0

I found the answer. When I checked my git repo I saw that there was a misspelling of a file which I had accidentally committed. I'd removed this from my file system, but it was still in my git repo. Removing this file, deleting all assets, recompiling and redeploying fixed it.

Scott S.
  • 749
  • 1
  • 7
  • 26
  • Just out of curiosity: Which file? Which content? – Ben Sep 06 '13 at 21:01
  • It was the bootstrap_and_overrides.css.less file. There was an older version with a typo in the file name. I'd deleted it from my file system, but forgot to delete it from my git repo. – Scott S. Sep 09 '13 at 13:12