如何更改默认 gem 版本
How to change default gem version
如有任何帮助,我们将不胜感激!
我尝试在 运行 捆绑包更新后重新配置我的 GitLab。但是运行进入下面列出的错误。
大多数时候报这种类型的错误会在错误中列出与之冲突的gem,但我的只是说它与厨师有问题,所以我不确定真正的问题是什么。
此时我正在全新安装 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 时出现以下错误:
ERROR: While executing gem ... (Gem::InstallError)
gem "json" cannot be uninstalled because it is a default gem
- Uninstall and reinstall ruby
- Set default ruby
- Add json to the Gemfile
gem "json", "~> 1.8.1"
- Edited the Gemfile.lock to use the correct json
- Deleted the Gemfile.lock
Error:
/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>'
我从 GitLab 支持了解到 运行 捆绑包更新 会破坏许多 GitLab 依赖项。
如有任何帮助,我们将不胜感激!
我尝试在 运行 捆绑包更新后重新配置我的 GitLab。但是运行进入下面列出的错误。
大多数时候报这种类型的错误会在错误中列出与之冲突的gem,但我的只是说它与厨师有问题,所以我不确定真正的问题是什么。
此时我正在全新安装 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 时出现以下错误:
ERROR: While executing gem ... (Gem::InstallError) gem "json" cannot be uninstalled because it is a default gem
- 当我尝试卸载版本 1.8.1 时出现以下错误:
- Uninstall and reinstall ruby
- Set default ruby
- Add json to the Gemfile
gem "json", "~> 1.8.1"
- Edited the Gemfile.lock to use the correct json
- Deleted the 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>'
我从 GitLab 支持了解到 运行 捆绑包更新 会破坏许多 GitLab 依赖项。