7

每次我做上限:部署 Capistrano 都会删除我的资产,说它们是不需要的。事实上,它们是必需的,为了让它们回来,我必须在每次执行 cap:deploy 后执行 cap:assets:precompile,否则我的站点没有样式或图像。

这是不是: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
4

1 回答 1

6

这是解决方案:https ://github.com/capistrano/capistrano/pull/422

要么添加

after "deploy", "assets:precompile"

在 deploy.rb 结束时,等待 capistrano gem 更新

或将 2 行添加到您的 capistrano gem 中

或者你可以直接从 github 更新 capistrano

gem 'capistrano', git: 'https://github.com/capistrano/capistrano.git'

我不推荐

于 2013-04-16T11:19:31.530 回答