【问题标题】:How do I fix a bad Capistrano deployment?如何修复糟糕的 Capistrano 部署?
【发布时间】:2012-07-26 15:28:24
【问题描述】:

昨晚进行了一次大更新,我的网站目前已关闭。我没有运气使用cap deploy:rollback。错误日志并没有告诉我太多。我在尝试部署时看到的最后一个错误是:

 ** [out :: website.com] You are trying to install in deployment mode after changing
 ** [out :: website.com] your Gemfile. Run `bundle install` elsewhere and add the
 ** [out :: website.com] updated Gemfile.lock to version control.
 ** [out :: website.com] 
 ** [out :: website.com] You have deleted from the Gemfile:
 ** [out :: website.com] * asset_sync
    command finished in 934ms

我的cap tail 只是说以下没有错误:

Migrating to AddSessionsTable (20120722094547)
Migrating to AddSlugToUserProjects (20120723204816)
Migrating to AddSlugIndexToUserProjects (20120723205558)
Migrating to CreateFriendlyIdSlugs (20120723210904)
Migrating to AddNameToUsers (20120723221700)
Migrating to AddSlugToUsers (20120723222456)
Migrating to CreateComments (20120724203252)

有什么帮助吗?

【问题讨论】:

    标签: ruby-on-rails deployment capistrano


    【解决方案1】:

    在您的开发服务器上运行bundle install,然后运行cap deploy。另一种可能的解决方案:将asset_sync 添加回您的 Gemfile。

    作为最后的手段,您可以运行cap -d deploy。它将逐步运行部署,要求您继续执行每一步。在单独的 shell 中登录生产服务器并在步骤之间手动进行一些调整。

    【讨论】:

      【解决方案2】:

      看来 Gemfile 的更改并不顺利。它是如何修复的:

      1. 登录到服务器,有 6 个 ruby​​ 进程正在占用所有可用的东西。这几乎可以肯定是独角兽进程试图启动但不能……killall -9 ruby
      2. cd 进入应用的当前目录
      3. RAILS_ENV=production bundle exec rake assets:precompile
      4. 服务 unicorn_whimseybox 启动

      看起来(在 unicorn.log 中),错误是: E, [2012-07-26T17:27:10.552912 #24818] 错误 -- : 未初始化的常量 AssetSync (NameError)

      【讨论】:

        【解决方案3】:

        在将一些 Gemfile source 行转换为块后,我遇到了同样的错误。

        该错误是由于生产中的旧 Bundler 版本 (1.7.3) 而开发中的 1.8.3。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2018-08-06
          • 1970-01-01
          • 2014-09-07
          • 1970-01-01
          • 2013-05-15
          • 1970-01-01
          相关资源
          最近更新 更多