【问题标题】:Could not find gem on the test (and possibly in the stage & prod) branch after removing from the master branch从 master 分支中删除后,在 test(可能在 stage 和 prod)分支上找不到 gem
【发布时间】:2015-04-23 14:06:58
【问题描述】:

我从项目的 Gemfile 中删除了 gem“auto_tagger”。一切看起来都在 master/dev 分支上工作。我使用脚本将分支合并到测试中。现在我收到此错误

Switched to branch 'test'
/opt/mount1/rvm/gems/ruby-2.1.1@global/gems/bundler-1.7.7/lib/bundler/resolver.rb:357:in `resolve': Could not find gem 'auto_tagger (>= 0) ruby' in the gems available on this machine. (Bundler::GemNotFound)

当下面的脚本被调用时(这不是完整的脚本,但它显示了失败的地方)

 def chef_refresh(root_dir = nil, environment = 'staging', branch)
        dir_prefix = root_dir.nil? ? nil : File.join(root_dir, '/')
        check_environment(environment)
        puts "Checking out #{branch} inside the something_chef_repo projects."
        system("git checkout #{branch}")
        check_branch(environment, branch)
        puts "git pull something_chef_repo"
        system("git pull") || raise("unable to complete git pull for gemini_chef_repo")
        puts "running bundle"
        system("bundle")
        puts "running berks"
        system("berks install")

【问题讨论】:

  • 为什么要删除一个明显被您的应用程序使用的 gem?问题是关于如何完全删除或如何使其再次工作?
  • 此 gem 必须在您当前工作目录(“test”分支)的 Gemfile 中引用。如果您没有使用该 gem,请适当更新 Gemfile。如果您需要宝石(我怀疑),请使用 bundle install 将其取回。
  • 不再需要 gem。我正在尝试完全删除它。在我们的环境中,我们使用 jenkins 将 master 的分支合并到 test 到 stage 和 prod。在每个合并过程之后,都会运行脚本以执行主厨刷新。在厨师刷新脚本期间,事情会爆炸。
  • 当我从 master/dev 分支的 gemfile 中删除 gem 并将分支合并到 test 时,它是否没有更新 test 分支上的 gemfile?

标签: ruby git chef-infra


【解决方案1】:

事实证明,chef-refresh 脚本仍然需要 gem 自动标记。在将其合并到其他分支之前,我必须在 master/dev 分支上重新添加 gem 和 bundle install。感谢 spickermann 和 Thom Parkin

【讨论】:

    猜你喜欢
    • 2018-07-24
    • 2020-09-14
    • 1970-01-01
    • 1970-01-01
    • 2015-11-06
    • 2012-08-25
    相关资源
    最近更新 更多