mercredi 9 mars 2016

rails not compiling changes to a specific stylesheet on deployment to production

I have a Rails 3.2 app that is appearing to not compile changes to a specific style sheet on deployment to production. The file is admin.scss and it is being compiled within public/assets but as an old version, without the changes I have made. This is only happening in our production environment and working ok on our staging env.

I have tried running RAILS_ENV=production bundle exec rake assets:precompile on our box and I can see the admin.css shows the changes but the area of the site using it fails to load the css file and we see a page without any styles.

I have tried deleting it from public/assets and running our Capistrano deployment task again but it just generates the old version again. Our Capfile contains require 'capistrano/rails/assets' to handle assets.

I am a bit lost on what to try next as it is confusing it works on staging but not production.

Here is our env rb files.

production.rb

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

staging.rb

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

Anyone have any ideas?

Aucun commentaire:

Enregistrer un commentaire