6

我有用于使用 capistrano 部署的生产 Rails 3.2.3 应用程序。当我决定将 rails 升级到 3.2.11 时,我执行了以下步骤:

  1. 在 Gemfile 中更改了 rails 版本
  2. 运行“捆绑更新导轨”
  3. 从供应商/缓存、Gemfile 和 Gemfile.lock 推送新的 gem
  4. 运行“上限生产部署”

Capistrano 现在失败并出现错误:

  * 2013-01-11 15:58:25 executing `deploy:assets:precompile'
    triggering before callbacks for `deploy:assets:precompile'
  * 2013-01-11 15:58:25 executing `deploy:assets:update_asset_mtimes'
  * executing "[ -e /home/deploy/projects/otv/shared/assets/manifest.yml ] && cat /home/deploy/projects/otv/shared/assets/manifest.yml || echo"
    servers: ["xxx.xxx.99.51"]
    [xxx.xxx.99.51] executing command
    command finished in 28ms
  * executing "cd -- /home/deploy/projects/otv/releases/20130111095812 && export LANG=en_US.UTF-8 && /usr/local/bin/bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile && cp -- /home/deploy/projects/otv/shared/assets/manifest.yml /home/deploy/projects/otv/releases/20130111095812/assets_manifest.yml"
    servers: ["xxx.xxx.99.51"]
    [xxx.xxx.99.51] executing command
 ** [out :: xxx.xxx.99.51] cp: cannot stat ‘/home/deploy/projects/otv/shared/assets/manifest.yml’: No such file or directory
    command finished in 18773ms

我尝试使用其他项目执行这些步骤,该项目以前成功地使用 capistrano 进行部署,结果相同。

我的Gemfile 和 deploy.rb

4

3 回答 3

4

FWIW,我在将 Capistrano 更新到 > 2.14.0 后得到了这个:

*** [err :: ourapp.net] cp: cannot stat `/home/deploy/www/ourapp/shared/assets/manifest.yml'
*** [err :: ourapp.net] : No such file or directory

我认为将资产符号链接到共享目录可以解决它,但我没有搞砸(必须得到这个部署),而是将上限降级回 2.13.5。

于 2013-01-15T21:19:24.300 回答
1

I had the same issue.

New versions of capistrano now have some code to handle the shared assets path symlinking. My config/deploy.rb had some code to handle this, and the paths were conflicting with each other. I just removed this line from it to solve the problem:

run "ln -nfs #{shared_path}/public/assets #{release_path}/public/assets"
于 2013-01-11T19:38:18.757 回答
0

您是否在升级之前删除了远程服务器上的所有资产?

有时一些旧的参考资料可能会导致这种问题

干杯,杰里米

于 2013-01-11T16:25:33.860 回答