生产中的 Rails 资产镜像
我发现资产图像有一些奇怪的行为
如果我在托管 - /assets/image.png 的生产模式下运行独角兽 - 服务器给我空白图像,即文件存在,但 size=0 。同时在本地主机上我以独角兽开发模式运行 - 一切正常,然后我在托管上运行 webrick - 图像显示正常。之后,我在本地主机上以生产模式运行 unicorn 并且图像停止显示,然后我在开发图像中运行 unicorn 已经不起作用。
Rails 3.1.0.rc6,之后我在托管上更新到 rc8 但没有发生任何事情
也许生产模式会构建一些缓存,这些缓存会永远保留?
I found some strange behavior of assets images
If I run unicorn in production mode at hosting - /assets/image.png - server give me blank image ie file exist, but size=0 . In same time at localhost I run in unicorn development mode - and all works fine, Then I run webrick at hosting - images are display fine. After that I run unicorn in production mode at localhost and images stops display, then I run unicorn in development images already doesn't work.
Rails 3.1.0.rc6, after that I update to rc8 at hosting but nothing happened
Maybe production mode build some cache, which remains forever?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有不同的事情可能会出错,所以这里的想法你必须检查:
bundle exec rake assets:clean
。这将清理周围的所有资源。bundle exec rake assets:precompile
。因此,目录/public/assets
应填充附加哈希值的资源(例如icon_add-96985e087048a8c2e09405494509750d.gif
而不是icon-add.gif
)。我希望其中的一些想法能够帮助您找到问题的根源。
There are different things that may go wrong, so here the ideas you have to check:
bundle exec rake assets:clean
. This will clean all resources hanging around.bundle exec rake assets:precompile
afterwards. As a result, the directory/public/assets
should be filled with assets with the hash appended (e.g.icon_add-96985e087048a8c2e09405494509750d.gif
instead oficon-add.gif
).I hope some of the ideas will help you find the source of your problem.