【问题标题】:Capistrano multi stage deployment acts weird with bundler (path problems)Capistrano 多阶段部署对捆绑器的行为很奇怪(路径问题)
【发布时间】:2011-07-08 16:36:39
【问题描述】:

我在 capistrano/bundler 遇到了一个非常奇怪的问题,我被困住了...... 我有两个阶段:生产和分期 当我执行cap production bundle:install 时,它运行良好并运行:

executing "cd /var/www/whatever/releases/20110506112617 && bundle install --gemfile /var/www/whatever/releases/20110506112617/Gemfile --path /var/www/whatever/shared/bundle --deployment --quiet --without development test"

一切都很好,但是当我运行 cap staging bundle:install 时,我得到了这个:

failed: "sh -c 'cd /var/www/staging.whatever/releases/shared && bundle install --gemfile /var/www/staging.whatever/releases/shared/Gemfile --path /var/www/staging.whatever/shared/bundle --deployment --quiet --without development test'" on whatever.org

不应该是

sh -c 'cd /var/www/staging.whatever/releases/shared && bundle install --gemfile /var/www/staging.whatever/releases/shared/Gemfile

而是

sh -c 'cd /var/www/staging.whatever/releases/20110506112617 && bundle install --gemfile /var/www/staging.whatever/releases/20110506112617/Gemfile

current_path 出了点问题,我不知道为什么...它总是指向完全错误的发布/共享...

我运行 capistrano 2.6.0,非常感谢任何帮助

-- 弗洛

【问题讨论】:

  • stage.rb 部署文件中的:deploy_to 路径是否被更改?
  • 当 bundler 在我的 cap production deploy 末尾执行时,我遇到了类似的问题,它与您看到的“失败”行相同。
  • 运气好吗?我也刚开始遇到类似的问题。我的开发阶段配方有效,但是由于捆绑程序无法访问 Gemfile.lock 导致生产失败,我得到“--deployment 标志需要 Gemfile.lock。请确保在部署之前已将 Gemfile.lock 检查到版本控制中。”已签入

标签: capistrano bundler


【解决方案1】:

只需删除“共享”版本

rm -rf /var/www/staging.whatever/releases/shared

【讨论】:

  • 是的,这对我有用。我不知道/var/www/XXX/releases/shared 最初是如何创建的。有什么想法吗?
  • 您可能已经为您的日志或 pid 文件指定了一次 /var/www/XXX/releases/shared。由于 Capistrano 按名称 DESC 订购文件夹并排在第一位,因此 shared 始终排在第一位。不过可能还有很多其他原因;)
猜你喜欢
  • 1970-01-01
  • 2011-11-10
  • 1970-01-01
  • 2011-06-24
  • 1970-01-01
  • 2016-03-05
  • 2012-10-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多