Home Articles

升级到Rails 3.2.11后,Capistrano部署失败

Asked
Viewed 592 times
6

我有 生产环境 Rails 3.2.3应用程序,我用它来使用capistrano进行部署 . 当我决定将rails升级到3.2.11时,我做了以下步骤:

  • 在Gemfile中更改了rails版本

  • 运行"bundle update rails"

  • 从供应商/缓存,Gemfile和Gemfile.lock推送新的宝石

  • 运行"cap production deploy"

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 and deploy.rb

3 Answers

  • 4

    我遇到过同样的问题 .

    新版本的capistrano现在有some code来处理共享资产路径符号链接 . 我的 config/deploy.rb 有一些代码来处理这个问题,而且路径相互冲突 . 我刚从它中删除了这一行来解决问题:

    run "ln -nfs #{shared_path}/public/assets #{release_path}/public/assets"
    
  • 1

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

    有时一些旧的引用可能会导致这种问题

    干杯,Jérémy

  • 0

    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 .

Related