0

I've got a strange problem. My rails app looks fine in prod, but I recently started working on it on a different computer, and the front page seems to have forgotten about it's margins. When I commit everything and push it out to production, there are no problems.

I'm using twitter-bootstrap-rails and have not customized the stylesheets at all.

local

production

This picture has everything crammed against the left side of the browser, on my local machine

This picture shows production, where everything is properly aligned

DVG
  • 17,392
  • 7
  • 61
  • 88

3 Answers3

0

This could be due to the mode you are running the server. My guess is that you will see the difference when you run rails s development vs rails s production.

I ran into this before, and it was an issue where my CSS was compiling incorrectly because I had some bad CSS floating around.

It can be pretty insidious to track down, so first look through your assets hierarchy and look for anything that is out of place. After that, you'll have to investigate using a browser and inspection tools like through Chrome.

jwg2s
  • 806
  • 1
  • 12
  • 25
0

Had similar issues with the fixed header bar which lost it's style. Looks like it was the update to the twitter-bootstrap-rails gem from 2.0.3, which I was using to the new 2.1.6.

With the update I then got an error about twitter-bootstrap-rails v2.1.6 break with error "rails app: method_missing': undefined methodless'

There has been a lot of discussion on the twitter-bootstrap-rails issue list: see v2.1.6 breaks app which explains a lot of the revised Gemfile configurations.

So far applying the suggestions hasn't resolved my issue of the header bar, which was dark, as per the Twitter Bootstrap examples, now appearing with a grey background like the LH nav bar. Suspect that it's something to do with the less compiling or linking of the assets.

Grant Sayer
  • 2,330
  • 1
  • 23
  • 34
  • Interestingly enough, my header bar displays with a light gray background in production instead of dark gray, which isn't intentional, but I do like it better so I'm not fussed. – DVG Nov 28 '12 at 13:58
  • Yeah it's not too bad. I just took a vanilla rails skeleton, applied the twitter-bootstrap generators and added theming. Then as a test took the header from one of the bootstrap examples and ended up with the standard dark background. – Grant Sayer Nov 29 '12 at 08:58
  • Noticed that on the update with the bootstrap 2.2.1 the Nav Bar class on the
    in the examples, includes the extra item of "navbar-inverse". I had previously used bootstrap 2.0 and suspect that it defaulted to navbar-inverse effect, but in the later version this has to be explicitly applied. When I toggled this class I could reproduce the problem I first encountered with the light grey background.
    – Grant Sayer Nov 29 '12 at 09:04
0

I'm not sure exactly what the problem was still, but once I linked the app to Pow on my Mac everything displays normally. Strange. Anyway, I'm not having a problem anymore.

DVG
  • 17,392
  • 7
  • 61
  • 88