Heroku does not display (find?). Css and .js files

I recently added a project to Heroku. However, none of the .css or .js files work.

I use Twitter Bootstrap.css and .js files. I have added files to the appropriate directories in suppliers / assets.

Based on other issues that I saw here, I upgraded from Bamboo to Cedar on Heroku. I also tried rake assets:precompile RAILS_ENV=production , changing config.assets.enabled = true to config.assets.enabled = false in application.rb, config.assets.compile = false config.assets.compile = true in production.rb and about as many combinations of the above things as I might have thought.

Everything works fine locally.

(Adding a link to github in an attempt to provide more information.) Https://github.com/moctopus/sixtydays

+4
source share
1 answer

By default, assets:precompile will not process css / js files in / vendor / assets. In production.rb you can use config.assets.precompile to get additional css / js files processed by the precompiler.

For example, if you had css / js bootstrap files css / js inside /vendor/assets/bootstrap , use:

 config.assets.precompile += %w[ bootstrap/*.css bootstrap/*.js ] 

Then rake assets:precompile process them and they will work on heroku.


see below: http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

The default compatibility for compiling files includes application.js, application.css, and all non-JS / CSS files

+7
source

Source: https://habr.com/ru/post/1399848/


All Articles