Capistrano 部署问题

Posted

技术标签:

【中文标题】Capistrano 部署问题【英文标题】:Capistrano deployment problems 【发布时间】:2014-05-30 12:36:41 【问题描述】:

当我输入时

cap production deploy

我明白了

Capfile locked at 3.1.0, but 3.2.0 is loaded

当我卸载 capistrano 3.2.0 我得到 ​​p>

Could not find capistrano-3.2.0 in any of the sources
Run `bundle install` to install missing gems.

我的 gemfile 有

gem 'capistrano', '~> 3.1'
gem 'capistrano-rails', '~> 1.1'

还有 Capfile

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails/assets'

在这种情况下该怎么办?

【问题讨论】:

【参考方案1】:

config/deploy.rblock '3.1.0'

将其更改为 '3.2.0' 就足够了,现在它可以工作了。

【讨论】:

3.2.1 现已发布。有没有办法指定3.2.* 据我所知,您必须指定特定版本的 capistrano。 @squixy 可以使用lock '>=3.2.0'等运算符【参考方案2】:

Bundler 不应该为您处理这个问题吗?如果您在 Gemfile 中指定了版本,则可以在 config/deploy.rb 中删除锁定版本。那么bundle exec cap production deploy 应该可以解决问题。

【讨论】:

以上是关于Capistrano 部署问题的主要内容,如果未能解决你的问题,请参考以下文章