inspec / train

Transport Interface to unify communication over SSH, WinRM, and friends.
Apache License 2.0
119 stars 87 forks source link

vmware.rb cannot load such file #718

Closed potatoqualitee closed 2 years ago

potatoqualitee commented 2 years ago

Version:

I installed inspec yesterday from the website and --version shows 4.52.9

Environment:

Windows 11, PowerShell 5.1

Scenario:

I'm trying to use inspec as described in VMware's dod-compliance-and-automation repository

Steps to Reproduce:

Install inspec on Windows 11, clone the dod compliance repo, move the directories to the appropriate paths. Set appropriate environmental variables as described in their repo.

Run C:\opscode\inspec\bin\inspec.bat exec C:\Inspec\Profiles\vmware-vsphere-vcenter-7.0-stig-baseline -t vmware:// from PowerShell 5.1 on Windows 11, as described in the docs.

Expected Result:

No exceptions

Actual Result:

Traceback (most recent call last):
        16: from C:/opscode/inspec/bin/inspec:301:in `<main>'
        15: from C:/opscode/inspec/bin/inspec:301:in `load'
        14: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-bin-4.52.9/bin/inspec:11:in `<top (required)>'
        13: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.52.9/lib/inspec/base_cli.rb:35:in `start'
        12: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
        11: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
        10: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
         9: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
         8: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.52.9/lib/inspec/cli.rb:301:in `exec'
         7: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.52.9/lib/inspec/cli.rb:301:in `new'
         6: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.52.9/lib/inspec/runner.rb:79:in `initialize'
         5: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.52.9/lib/inspec/runner.rb:87:in `configure_transport'
         4: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.52.9/lib/inspec/backend.rb:38:in `create'
         3: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.8.6/lib/train/transports/vmware.rb:16:in `connection'
         2: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.8.6/lib/train/transports/vmware.rb:16:in `new'
         1: from C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.8.6/lib/train/transports/vmware.rb:37:in `initialize'
C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.8.6/lib/train/transports/vmware.rb:37:in `require_relative': cannot load such file -- C:/opscode/inspec/embedded/lib/ruby/gems/2.7.0/gems/train-3.8.6/lib/train/transports/local (LoadError)

I filed an issue here https://github.com/vmware/dod-compliance-and-automation/issues/74 but they suggested it's an issue with train.

Thanks, Chrissy

Vasu1105 commented 2 years ago

Ths is fixed here https://github.com/inspec/train/pull/717

potatoqualitee commented 2 years ago

Thanks, @Vasu1105 -- any chance this train can be added to the installers on https://www.chef.io/downloads/tools/inspec

potatoqualitee commented 2 years ago

For anyone who doesn't know anything about Ruby, like me, this will get you updated nicely on Windows.

$ENV:RUBYOPT = 'rubygems'
$ENV:RUBY_DIR = 'C:\opscode\inspec\embedded'
$ENV:GEM_PATH = 'C:\opscode\inspec\embedded\lib\ruby\gems\2.7.0\gems'
$ENV:PATH = 'C:\opscode\inspec\embedded\bin;' + $ENV:PATH
gem update train
gem install inspec_tools