How do I precompile assets in rails in development environment?

*爱你&永不变心* 提交于 2019-12-22 05:24:08

问题


I want to manually precompile some assets in my dev environment (to check the content of the compiled js and css files) from the command line.

I am running

RAILS_ENV=development bundle exec rake assets:precompile

but my js and css are not compiled in the public/assets folder, only the images are. Any idea why that may be happening?


回答1:


Try adding this to your config/environments/production.rb :

config.assets.precompile += %w( *.css *.js )


来源:https://stackoverflow.com/questions/10081832/how-do-i-precompile-assets-in-rails-in-development-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!