dcosson / vagrant-unison2

Vagrant plugin to sync local files to VM using Unison over SSH
MIT License
50 stars 8 forks source link

Unable to install on Windows #23

Open kichik opened 8 years ago

kichik commented 8 years ago

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 commented 8 years ago

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
JCook21 commented 8 years ago

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

dcosson commented 8 years ago

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)

JCook21 commented 8 years ago

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 commented 8 years ago

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!

dcosson commented 8 years ago

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

kichik commented 8 years ago

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?

JCook21 commented 8 years ago

@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.

kousun12 commented 8 years ago

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

dcosson commented 8 years ago

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