Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does rails precompile task do non-digest assets

When I do: rake assets:precompile RAILS_ENV=production I get for example the following files in my public/assets folder:

  • application-7af6c31514bcdd4cce3c96892af4487f.js
  • application-7af6c31514bcdd4cce3c96892af4487f.js.gz
  • application.js
  • application.js.gz

The last 2 are a problem because it causes the compiled version to get served in development and I don't understand why they are being generated.

I have the following line in my production.rb:

config.assets.digest = true
like image 628
pguardiario Avatar asked Feb 20 '23 04:02

pguardiario


1 Answers

To stop the creation of the non-hashed filenames in public use:

rake assets:precompile:primary RAILS_ENV=production
like image 151
Damon Mannion Avatar answered Mar 06 '23 01:03

Damon Mannion