每次我做一个上限:部署Capistrano正在删除我的资产,说他们不需要。实际上它们是必需的,为了让它们恢复,我必须做一个上限:资产:每次我执行上限后预编译:部署,否则我的网站没有样式或图像。
这有什么用:normalize_asset_timestamps在部署期间不起作用:finalize_update?
Capistrano v2.14.1,Rails v3.2.11
** Removing assets that haven't been deployed for 10080 minutes...
* executing ...
** [out :: server.com] comm:
** [out :: server.com] file 2 is not in sorted order
** [out :: server.com] Removing unneeded asset: application-66c9f07224da686e6b5a64752995df38.css
** [out :: server.com] Removing unneeded asset: application-66c9f07224da686e6b5a64752995df38.css.gz
** [out :: server.com] Removing unneeded asset: application-7b53d1e1411ed0a62ea32ace5ee4e7c2.js
** [out :: server.com] Removing unneeded asset: application-7b53d1e1411ed0a62ea32ace5ee4e7c2.js.gz
** [out :: server.com] Removing unneeded asset: application.css
** [out :: server.com] Removing unneeded asset: application.css.gz
** [out :: server.com] Removing unneeded asset: application.js
** [out :: server.com] Removing unneeded asset: application.js.gz
答案 0 :(得分:6)
以下是解决方案:https://github.com/capistrano/capistrano/pull/422
添加
after "deploy", "assets:precompile"
在deploy.rb结束时,等待capistrano gem更新
或将2行加入capistrano宝石
或者您可以直接从github更新capistrano
gem 'capistrano', git: 'https://github.com/capistrano/capistrano.git'
我不会推荐