Rails 4, Heroku, Bootstrap - Overrides not working in Production

808 views Asked by At

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.

1

There are 1 answers

2
Scott S. On BEST ANSWER

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.