如何更改默认的宝石版本

时间:2015-02-24 22:36:49

标签: ruby json gem

非常感谢任何帮助!

我在运行捆绑更新后尝试重新配置我的GitLab。但遇到下面列出的错误。

大部分时间报告这种类型的错误,它会与错误中列出的宝石会被列在错误中,但是我只是说它在厨师方面遇到了麻烦,所以我不确定这里真正的问题是什么

此时我正在全面安装GitLab。我刚刚运行了捆绑更新而没有问题。试图运行Gitlab-ctl重新配置并得到下面列出的错误。

Ruby版本: ruby​​ 2.2.0p0(2014-12-25修订版49005)[x86_64-linux]

RVM版本: rvm 1.26.10

已安装的JSON版本: json(1.8.1)

我试过了:

  • 捆绑安装
  • 捆绑更新
  • 安装较新版本的json(1.8.2),然后卸载旧的json
    • 当我尝试卸载1.8.1版时,它给出了以下错误:

        

      错误:执行gem时...(Gem :: InstallError)   宝石" json"无法卸载,因为它是默认宝石

    •   
  •   
  • 卸载并重新安装ruby
  •   
  • 设置默认红宝石
  •   
  • 将json添加到Gemfile

         
        

    gem" json","〜> 1.8.1"

  •     
  • 编辑Gemfile.lock以使用正确的json
  •     
  • 删除了Gemfile.lock
  •     
    的错误:

  
/opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2052:in `raise_if_conflicts': can't activate json-1.8.2, already activated json-1.8.1 (Gem::LoadError)
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1262:in `activate'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:96:in `block in require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:95:in `each'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:95:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/json_compat.rb:20:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/http/json_input.rb:20:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/rest.rb:32:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/search/query.rb:21:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/dsl/data_query.rb:19:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/mixin/language.rb:20:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/dsl/platform_introspection.rb:217:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/resource.rb:21:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/dsl/recipe.rb:20:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/provider.rb:22:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/provider/execute.rb:21:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/provider/script.rb:20:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/provider/windows_script.rb:19:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/provider/batch.rb:19:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/providers.rb:19:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef.rb:25:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/lib/chef/application/solo.rb:19:in `<top (required)>'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
        from /opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-11.12.2/bin/chef-solo:23:in `<top (required)>'
        from /opt/gitlab/embedded/bin/chef-solo:23:in `load'
        from /opt/gitlab/embedded/bin/chef-solo:23:in `<main>'

1 个答案:

答案 0 :(得分:-3)

我从GitLab支持中了解到,运行捆绑更新会破坏许多GitLab依赖项。