LoginSignup
12
11

More than 5 years have passed since last update.

Vagrant 1.7.4 -> 1.8.1 にアップデートしたらプラグインエラーが発生したのでその対応

Last updated at Posted at 2016-01-08

Vagrant を 1.8.1 にアップデートしたらエラーが発生しました。

$ vagrant box list
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 "net-ssh":
  In Gemfile:
    vagrant-chef-zero (>= 0) ruby depends on
      chef (~> 11.0) ruby depends on
        net-ssh (~> 2.6) ruby

    net-ssh (>= 2.6.5) ruby

    net-ssh (>= 2.6.5) ruby

    vagrant (= 1.8.1) ruby depends on
      net-ssh (~> 3.0.1) ruby

    net-ssh (>= 2.6.5) ruby

    net-ssh (>= 2.6.5) ruby

古いプラグインを削除して一つ一つインストールしてくださいとのこと。

~/.vagrant.d/plugins.json のファイルの中身を見て、現在インストールされている Vagrant プラグインを確認します。

~/.vagrant.d/plugins.json
{
  "version": "1",
  "installed": {
    "landrush": {
      "ruby_version": "2.0.0",
      "vagrant_version": "1.7.4",
      "gem_version": "",
      "require": "",
      "sources": []
    },
    "vagrant-omnibus": {
      "ruby_version": "2.0.0",
      "vagrant_version": "1.7.4",
      "gem_version": "",
      "require": "",
      "sources": []
    },
    "vagrant-chef-zero": {
      "ruby_version": "2.0.0",
      "vagrant_version": "1.7.4",
      "gem_version": "",
      "require": "",
      "sources": []
    },
    "vagrant-vbguest": {
      "ruby_version": "2.0.0",
      "vagrant_version": "1.7.4",
      "gem_version": "",
      "require": "",
      "sources": []
    },
    "sahara": {
      "ruby_version": "2.0.0",
      "vagrant_version": "1.7.4",
      "gem_version": "",
      "require": "",
      "sources": []
    },
    "vagrant-vbox-snapshot": {
      "ruby_version": "2.0.0",
      "vagrant_version": "1.7.4",
      "gem_version": "",
      "require": "",
      "sources": []
    },
    "vagrant-aws": {
      "ruby_version": "2.0.0",
      "vagrant_version": "1.7.4",
      "gem_version": "",
      "require": "",
      "sources": []
    }
  }
}

jq がインストールされている場合は、以下のコマンドで Vagrant プラグインの一覧が取得できます。

$ jq -r '.installed | keys[]' ~/.vagrant.d/plugins.json
landrush
sahara
vagrant-aws
vagrant-chef-zero
vagrant-omnibus
vagrant-vbguest
vagrant-vbox-snapshot

プラグインの一覧を記録したら、~/.vagrant.d/plugins.json~/.vagrant.d/gems を削除します。

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

必要なプラグインを一つ一つインストールします。

Vagrant 1.8 から snapshot 機能が使えるようになった1ので、vagrant-vbox-snapshot は外します。また、vagrant-chef-zero も互換性が無くエラーが出たので除外します。

vagrant plugin install landrush
vagrant plugin install sahara
vagrant plugin install vagrant-aws
vagrant plugin install vagrant-omnibus
vagrant plugin install vagrant-vbguest

プラグインのインストール完了。Vagrant Box 一覧を表示してみます。

$ vagrant box list
ARTACK/debian-jessie  (virtualbox, 8.1.0)
coreos-alpha          (virtualbox, 779.0.0)
dummy                 (aws, 0)
fedora_inst           (virtualbox, 0)
jimmidyson/centos-7.1 (virtualbox, 1.1.2)
ubuntu14.04           (virtualbox, 0)

エラーが発生しなくなりました。これで無事アップデート完了です。

12
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
11