BerlinVagrant / vagrant-dns

A plugin to manage DNS records for vagrant environments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't install vagrant-dns despite latest vagrant and ruby

timirnich opened this issue · comments

I'm failing to install vagrant-dns although I'm on the latest vagrant version (as per instructions in Readme.md) and installed ruby 3.1.0 via frum. It seems vagrant still sees the default old ruby version that comes with MacOS.

~> frum versions

  • 3.1.0
    ~> ruby -v
    ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin20]
    ~> vagrant -v
    Vagrant 2.2.19
    ~> vagrant plugin install vagrant-dns
    Installing the 'vagrant-dns' plugin. This can take a few minutes...
    Vagrant failed to properly resolve required dependencies. These
    errors can commonly be caused by misconfigured plugin installations
    or transient network issues. The reported error is:

io-event requires Ruby version >= 3.0. The current ruby version is 2.7.4.191.

Any ideas how I can convince vagrant to use the right ruby version?

If you've installed vagrant through the official binary, vagrant ships with it's own ruby (not 100% sure about the brew install, but most likely the same)

I assume you ran into an issue where you got an error message during install like that:

io-event requires Ruby version >= 3.0. The current ruby version is 2.7.4.191.

Long story short, it seems vagrant has as an issue resolving sub-sub-dependencies correctly, when installing plugins.

I'll try and publish a workaround/fix when I find the time

@timirnich The quick fix in #70 is not really a good fix, but would work for you. I'm not comfortable merging it (yet). As a workaround, you might build the plugin yourself:

$ git clone --single-branch --branch fix/69-vagrant-depenedency-resolve-workaround git@github.com:BerlinVagrant/vagrant-dns.git
$ cd vagrant-dns
$ export TEST_RUBY_VERSION='2.6.8' # or whatever ruby version you have working on your system (< 3.0)
$ export TEST_VAGRANT_VERSION=v2.2.19
$ bundle install
$ rake build
$ cd # leave the plugin checkout, it would confuse vagrant in the next step 
$ vagrant plugin install path/to/vagrant-dns/pkg/vagrant-dns-2.2.1.gem 

Thank you! I'll try asap...

released fix as v2.2.2