ruby-on-rails-4deis

Deis is not running assets:precompile in production environment


I'm using image-url assets helper in my stylesheet files like the following:

.page-hero {
  background: image-url('hero-bg.jpg') no-repeat center;
}

I'm trying to deploy a rails application to Deis and it runs fine except it does the assets recompilation in development environment which doesn't use the fingerprinted version of the asset files.

Here are the steps I did in deis so far.

deis create testapp
deis config:set RAILS_ENV=production
git push deis master

I tried to run RAILS_ENV=production rake assets:precompile locally while setting environment to production and it uses the fingerprinted version of the asset files.

is there is anyway I can tell deis to run rake assets:precompile under production environment ?

UPDATE:

I tried deploying on Heroku -as both Heroku and Deis use the same image- and it worked fine.

I thought this was because slugbuilder doesn't honor runtime configuration during execution but I found the following pull request already merged.

Expose runtime configuration during slugbuilder execution #960


Solution

  • After Upgrading from deis 1.4.0 to deis 1.4.1 destroying the app then deploying it again it worked fine.

    The 1.4.1 reverts the following: