Rails 4: assets not loading in production

前端 未结 18 1378
梦如初夏
梦如初夏 2020-11-29 15:15

I\'m trying to put my app into production and image and css asset paths aren\'t working.

Here\'s what I\'m currently doing:

  • Image assets live in /app/a
18条回答
  •  -上瘾入骨i
    2020-11-29 16:16

    In rails 4 you need to make the changes below:

    config.assets.compile = true
    config.assets.precompile =  ['*.js', '*.css', '*.css.erb'] 
    

    This works with me. use following command to pre-compile assets

    RAILS_ENV=production bundle exec rake assets:precompile
    

    Best of luck!

提交回复
热议问题