agiledivider / vagrant-hostsupdater

MIT License
1.15k stars 130 forks source link

Installation fails on fedora with 'conflicting dependencies nokogiri (= 1.6.3.1) and nokogiri (= 1.8.1)' #147

Closed BenjaminLaprise closed 6 years ago

BenjaminLaprise commented 6 years ago

Ho there, I'm trying to install vagrant-hostsupdater on Fedora 27 and it fails with the following error message:

Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
/usr/share/gems/gems/psych-2.2.2/lib/psych.rb:228: warning: already initialized constant Psych::LIBYAML_VERSION
/usr/share/ruby/psych.rb:228: warning: previous definition of LIBYAML_VERSION was here
/usr/share/gems/gems/psych-2.2.2/lib/psych.rb:230: warning: already initialized constant Psych::FALLBACK
/usr/share/ruby/psych.rb:230: warning: previous definition of FALLBACK was here
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

conflicting dependencies nokogiri (= 1.6.3.1) and nokogiri (= 1.8.1)
  Activated nokogiri-1.8.1
  which does not match conflicting dependency (= 1.6.3.1)

  Conflicting dependency chains:
    nokogiri (= 1.8.1), 1.8.1 activated

  versus:
    nokogiri (= 1.6.3.1)

  Gems matching nokogiri (= 1.6.3.1):
    nokogiri-1.6.3.1
lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 27 (Twenty Seven)
Release:    27
Codename:   TwentySeven
uname -a
Linux hpbenlocalhost 4.14.13-300.fc27.x86_64 #1 SMP Thu Jan 11 04:00:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
gem list | grep nokogiri

says I don't have any installed

sudo gem list | grep nokogiri
nokogiri (1.8.1)

I tried running this:

gem install --install-dir ~/.vagrant.d/gems nokogiri -v '1.6.3.1' 

succeded, but plugin installation still failed.

BenjaminLaprise commented 6 years ago

I realized I had the gem installed by the system with dnf. Uninstalling the package and then running the plugin install command again did solve the issue:

sudo dnf remove -y rubygem-nokogiri
vagrant plugin install vagrant-hostsupdater                                       
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
/usr/share/gems/gems/psych-2.2.2/lib/psych.rb:228: warning: already initialized constant Psych::LIBYAML_VERSION
/usr/share/ruby/psych.rb:228: warning: previous definition of LIBYAML_VERSION was here
/usr/share/gems/gems/psych-2.2.2/lib/psych.rb:230: warning: already initialized constant Psych::FALLBACK
/usr/share/ruby/psych.rb:230: warning: previous definition of FALLBACK was here
Fetching: vagrant-hostsupdater-1.0.2.gem (100%)
Installed the plugin 'vagrant-hostsupdater (1.0.2)'!

:tada: