Font size render issue with Rails 4.1.6 + Haml

December 7, 2015 890 views
Ruby on Rails Ruby

Just upgraded a Rails 4.1.6 app to use Haml and I'm noticing the font size on the server is significantly larger than in development on the same browser. Aside from my outdated Rails version, does anyone have any clues as to what might be causing this?

I love the simplicity of Haml and want to continue using it, but if I can't find a fix, I'll probably switch back to ERB.

  • CSS - all the same (14px font size) prod + development
  • Development (Ruby 2.0.0p598 - windows, Rails 4.1.6)
  • Prod (Ruby 2.1.3, Rails 4.1.6)
  • You might try again

    rake assets:precompile

    in case you have old compiled stylesheets. HAML won't be the problem, it's more likely how the stylesheets are being read. You might also check that you don't have duplicates of the problematic styles, which may be read in different orders in development versus your production environments.

  • I've rerun

    bundle exec rake assets:precompile RAILS_ENV=production

    various times since the switch to HAML. Though, I haven't cleared out the /public/assets folder, so I'll give that a shot and recompile to see what happens.

    That's also true, I didn't think about duplicate styles read in different orders of dev vs. prod I'll definitely look into that. From what I recall, Chrome's dev console was reporting the affected styles on the same line from the application.css file so I don't think that's the issue, but I'll double check that.

    Thanks for your reply. If I get this fixed, I'll post an update. If not, I think I'll switch back to ERB. Apparently, it's slightly faster than HAML, but I'll sure miss the syntax!

Be the first one to answer this question.