Rails 3.1 Asset pipeline - Why my images do not precompile for production?

后端 未结 2 523
刺人心
刺人心 2020-12-29 09:41

When running:

rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets

Everything precompiles but not my /app/assets/imag

相关标签:
2条回答
  • 2020-12-29 10:23

    Found a solution: Add to environment/production.rb

    config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif] 
    

    Why isn't this default ;ike this line says: (application.js, application.css, and all non-JS/CSS are already added)

    0 讨论(0)
  • 2020-12-29 10:44

    Use this format for the server:

    rails assets:precompile:all -e production
    
    0 讨论(0)
提交回复
热议问题