vagrant-unison2 icon indicating copy to clipboard operation
vagrant-unison2 copied to clipboard

Unable to install on Windows

Open kichik opened this issue 9 years ago • 10 comments

I have tried install the latest version on Windows 10 with Vagrant 1.8.5 and kept getting an error. Manually trying to install the gem shows the ruby_dep dependency requires Ruby 2.2.5 and above, but Vagrant comes bundled with Ruby 2.2.3. I have tried installing every version of vagrant-unison2 between 1.0.0 and 1.2.4 with no success.

ruby_dep 1.4.0 came out 2 days ago, so it might be related.

The full error message:

C:\>vagrant plugin install vagrant-unison2
Installing the 'vagrant-unison2' plugin. This can take a few minutes...
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:

An error occurred while installing ruby_dep (1.4.0), and Bundler cannot continue.
Make sure that `gem install ruby_dep -v '1.4.0'` succeeds before bundling.

Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.Gem::InstallError: ruby_dep requires Ruby version >= 2.2.5, ~> 2.2.

Manual installation error:

C:\>\HashiCorp\Vagrant\embedded\bin\gem.bat install ruby_dep -v 1.4.0
Fetching: ruby_dep-1.4.0.gem (100%)
ERROR:  Error installing ruby_dep:
        ruby_dep requires Ruby version >= 2.2.5, ~> 2.2.

C:\>\HashiCorp\Vagrant\embedded\bin\ruby.exe -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]

kichik avatar Aug 05 '16 21:08 kichik

I was able to work around the issue by manually installing ruby_dep first with:

vagrant plugin install ruby_dep --plugin-version 1.3.1
vagrant plugin install vagrant-unison2

kichik avatar Aug 05 '16 21:08 kichik

I'm also having this problem on OSX and can confirm that the same fix works.

JCook21 avatar Aug 11 '16 17:08 JCook21

Are you running Ruby < 2.2.5 when you get this error? (Looks like the default OSX ruby on El Capitan is 2.0.0)

dcosson avatar Aug 11 '16 17:08 dcosson

I'm using RVM and the output of ruby -v is 2.3.1. Maybe the plugin install is defaulting to the system Ruby - let me check to make sure the Ruby versions are correct.

JCook21 avatar Aug 11 '16 17:08 JCook21

That was the problem - rvm was using 2.2.0. After installing 2.3.1 and setting it as the default all is good, thanks!

JCook21 avatar Aug 11 '16 17:08 JCook21

👍 I'm going to close this, but lmk if the windows version is a different bug.

dcosson avatar Aug 11 '16 19:08 dcosson

I am unaware of an easy way to upgrade the bundled version of Ruby for Vagrant. Maybe vagrant-unison2 can directly require ruby_dep with a version supported by Vagrant 1.8.5 on Windows?

kichik avatar Aug 11 '16 19:08 kichik

@kichik the problem disappeared for me when I upgraded the version of Ruby my shell uses, not the bundled Vagrant one. Maybe that would help? I was using Ruby 2.2.0 installed with RVM. As soon as I installed 2.3.1 and set it as the default Ruby the problem went away. I'm on OSX though so not sure how this would work on Windows.

JCook21 avatar Aug 11 '16 20:08 JCook21

@dcosson also getting this on OS X, using rbenv w/ ruby 2.2.4 vagrant 1.8.5

kousun12 avatar Sep 07 '16 23:09 kousun12

I'm seeing this on OSX too once I updated to vagrant 1.8.5.

It looks like this PR is related https://github.com/mitchellh/vagrant/pull/7684 so hopefully vagrant 1.8.6 will fix this issue.

Until then a workaround is using an older vagrant or a newer ruby version, or installing vagrant unison from source by cloning this repo, running bundle install && bundle exec rake build and then vagrant plugin install pkg/vagrant-unison2-2.0.0.gem

dcosson avatar Sep 08 '16 17:09 dcosson