追踪并升级难以找到的红宝石宝石

时间:2016-07-01 22:25:05

标签: ruby rubygems vagrant bundler

在运行vagrant时,可能是用Ruby编写的,我收到了以下错误(vagrant --help产生了同样的错误信息):

$ vagrant plugin install vagrant-hostmanager
Vagrant experienced a version conflict with some installed plugins!
This usually happens if you recently upgraded Vagrant. As part of the
upgrade process, some existing plugins are no longer compatible with
this version of Vagrant. The recommended way to fix this is to remove
your existing plugins and reinstall them one-by-one. To remove all
plugins:

    rm -r ~/.vagrant.d/plugins.json ~/.vagrant.d/gems

Note if you have an alternate VAGRANT_HOME environmental variable
set, the folders above will be in that directory rather than your
user's home directory.

The error message is shown below:

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    vagrant (= 1.8.4) was resolved to 1.8.4, which depends on
      bundler (~> 1.12.5)

  Current Bundler version:
    bundler (1.11.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

在检查~/.vagrant.d/gems除了ruby之外什么都没有,我sudo gem update并检查bundler --version:1.12.5。 Bundler已更新。不幸的是,我在下次运行时遇到了同样的错误。 Vagrant似乎是从与gem update保存它们的位置不同的位置导入宝石。经过一些谷歌搜索,我发现gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 2.5.1
  - RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-linux-gnu]
  - INSTALLATION DIRECTORY: /var/lib/gems/2.3.0
  - USER INSTALLATION DIRECTORY: /home/dan/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /usr/bin/ruby2.3
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /home/dan/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/2.3.0
     - /home/dan/.gem/ruby/2.3.0
     - /usr/lib/x86_64-linux-gnu/rubygems-integration/2.3.0
     - /usr/share/rubygems-integration/2.3.0
     - /usr/share/rubygems-integration/all

查看GEM PATHS列表的gems目录,我只看到bundler-1.12.5个宝石。我知道如果Vagrant正在加载它,我的系统上必须存在bundler 1.11.2,所以locate bundler-1.11.2

/usr/share/rubygems-integration/all/specifications/bundler-1.11.2.gemspec

什么是gemspec?当我升级bundler gem时,我是否必须以某种方式指定其位置,以便保持一些元数据是最新的?

我刚刚使用apt-get更新了一个Debian软件包,而不是我系统软件包库中的软件包。

0 个答案:

没有答案