gpt4 book ai didi

ruby-on-rails-3.2 - Capistrano 删除 Assets

转载 作者:行者123 更新时间:2023-12-04 12:10:03 26 4
gpt4 key购买 nike

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

在部署:finalize_update 期间:normalize_asset_timestamps 不起作用吗?

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

最佳答案

这是解决方案: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'

我不推荐

关于ruby-on-rails-3.2 - Capistrano 删除 Assets ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14834218/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com