Rails 4.0.3 generating incorrect asset paths with asset_sync

前端 未结 2 1137
你的背包
你的背包 2021-01-05 01:55

I have used the asset_sync gem many times before with great success, but using it in a Rails 4.0.3 project seems to have caused a problem.

The assets are uploaded, h

2条回答
  •  旧巷少年郎
    2021-01-05 02:19

    You need to run everything assets related in production mode in rails 4.

    for example:

    rake assets:precompile RAILS_ENV=production
    

    If you run it in the default mode (development) the hash would be different so rails leaves off the hash all together.

    Also, you will want to do this before you start the server so it finds the files.

    NOTE: I think this change was to allow you to cache assets in development.

提交回复
热议问题