Capistrano 版本冲突

Too*_*tje 4 capistrano ruby-on-rails

我正在尝试上传我的 Rails 应用程序:

bin/cap production deploy
Run Code Online (Sandbox Code Playgroud)

但部署失败并显示此错误消息:

You have requested:                                                                     
  capistrano ~> 3.3.0                                                                   

The bundle currently has capistrano locked at 3.7.1.                                    
Try running `bundle update capistrano`                                                  

If you are updating multiple gems in your Gemfile at once,                              
try passing them all to `bundle update`
Run Code Online (Sandbox Code Playgroud)

我试图通过运行来解决这个问题:

bundle update capistrano
Run Code Online (Sandbox Code Playgroud)

但这并没有解决它。

我不明白的是我没有看到我的应用程序“要求 capistrano 3.3.0”。在我的 Gemfile 中,我将 Capistrano 设置为 3.7 版。

除了 capistrano gem 外,我还在使用:

gem capistrano-rails, '~> 1.2'
gem capistrano3-delayed-job, '~> 1.3'
gem capistrano-figaro-yml
Run Code Online (Sandbox Code Playgroud)

我的 Gemfile 位于:

https://github.com/acandael/personalsite/blob/master/Gemfile

有人知道我如何解决这个 Capistrano 版本问题吗?

感谢您的帮助,

安东尼

Ben*_*enj 5

请按照正确的顺序执行所有步骤(不要跳过任何步骤,因为您已经这样做了)

  1. cd 进入你的项目目录
  2. 运行bundle exec gem uninstall capistrano -a从您的包中删除所有 capistrano 版本
  3. 运行gem uninstall capistrano -a从系统中删除所有 capistrano 版本。请注意,如果您收到错误消息,您可能需要使用 root 访问权限运行它
  4. bundle install
  5. 运行bundle exec gem list capistrano它应该输出名称包含“capistrano”的所有已安装 gem。你应该只有一个版本capistrano gem
  6. 如果您有说明,请检查您的文件config/deploy.rbconfig/deploy/*.rblock 3.x.x,并确保它与步骤 5 中显示的安装版本匹配
  7. 在捆绑上下文中运行 cap bundle exec cap production deploy完全使用此命令行,不要使用 bin/cap)