vvchik / vagrant-serverspec

Vagrant plugin that integrates serverspec
MIT License
191 stars 28 forks source link

Cannot install vagrant-serverspec plugin #37

Closed ndobbs closed 4 years ago

ndobbs commented 5 years ago

Vagrant aborts the installation of this plugin due to a dependency needing a newer version of ruby,

vagrant version
Installed Version: 2.2.6
Latest Version: 2.2.6
vagrant plugin install vagrant-serverspec
Installing the 'vagrant-serverspec' plugin. This can take a few minutes...
Fetching: diff-lcs-1.3.gem (100%)
Fetching: rspec-expectations-3.9.0.gem (100%)
Fetching: rspec-mocks-3.9.0.gem (100%)
Fetching: rspec-3.9.0.gem (100%)
Fetching: rspec-its-1.3.0.gem (100%)
Fetching: net-telnet-0.1.1.gem (100%)
Fetching: sfl-2.3.gem (100%)
Fetching: specinfra-2.82.2.gem (100%)
Fetching: serverspec-2.41.5.gem (100%)
Fetching: os-0.9.6.gem (100%)
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:

activesupport requires Ruby version >= 2.5.0.
/opt/vagrant/embedded/bin/ruby --version
ruby 2.4.9p362 (2019-10-02 revision 67824) [x86_64-darwin13]

Please let me know if I should report this bug to the vagrant team.

01deEng1ish commented 5 years ago

By default, it will try to install activesupport 6.0.0, which requires Ruby 2.5.0. This can probably be fixed by adding this line to the vagrant-serverspec.gemspec file Gem.add_runtime_dependency ‘activesupport’, ‘< 6.0.0’

The activesupport gem is actually being pulled in by rspec_html_formatter, which requests activesupport >= 4.1.4

I don’t know whey the Vagrant Ruby is trying to pull in dependency gems that aren’t compatible with it. Perhaps that would be a defect against Vagrant.

endemics commented 4 years ago

@vvchik Now that #38 is merged, would it be possible to cut a new gem to make installation easier? That would close this issue. Thanks!

fasmat commented 4 years ago

Also experiencing this issue, any chance we get a new gem soon with the issue being fixed on master already?

Thanks!

Tocyuki commented 4 years ago

I have trouble too from this issue. Do you have any temporary solution with this issue?

01deEng1ish commented 4 years ago

These workaround I use:

  1. Attempt installation of plugin
  2. After install fails, modify the gemspec file, ~/.vagrant.d/gems/2.4.4/specifications/vagrant-serverspec-1.3.gemspec on my system, and manually add activesupport < 6.0.0 dependency
  3. Install serverspec plugin, which works for me at this point.
becw commented 4 years ago

I wasn't able to modify the gemspec file after the install failed -- Vagrant hadn't downloaded a gem for me to modify.

Here's the end to end workaround that worked for me:

# Clone this repository locally
git clone git@github.com:vvchik/vagrant-serverspec.git

# Build the gem
cd vagrant-serverspec
gem build vagrant-serverspec.gemspec

# Install the vagrant plugin from the local gem path
# (use your own local absolute path to the gem)
vagrant plugin install /Users/becw/repos/vagrant-serverspec/vagrant-serverspec-1.3.gem
vvchik commented 4 years ago

I've pushed the latest version to RubyGems. should work now, can you guys check?

endemics commented 4 years ago

I've pushed the latest version to RubyGems. should work now, can you guys check?

Hi @vvchik thanks for that.

Was it gem v1.5? It is marked as "yanked" from RubyGems

vvchik commented 4 years ago

No 1.5.0, I've pushed 1.5 first, but it does not follow semver, so I decided to reupload with new version number.

endemics commented 4 years ago

@vvchik I can confirm that v1.5.0 works fine for me (vagrant 2.2.6, macos Mojave 10.14.6, Virtualbox 6.0.16).

Thanks a lot!

fasmat commented 4 years ago

Solved the issue for me too

vvchik commented 4 years ago

Thanks, guys for confirmation. I will close this issue then. I enabled GitHub actions so upload of new versions will happen automatically on master merge now.