-2

chef verify shows error that gems dependencies on this path error C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'test-kitchen' (= 1.15.0) - did find: [test-kitchen-1.17.0] (Gem::MissingSpecVersionError)

GEM_PATH=C:/Users/ravikiran/AppData/Local/chefdk/gem/ruby/2.3.0;C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0', execute `gem env` for more information
        from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:320:in `to_spec'
        from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
        from C:/opscode/chefdk/bin/kitchen:19:in `<main>'
one
  • 11
  • 1

2 Answers2

0

how about installing the test-kitchen (= 1.15.0) gem, that it says is missing. See this on how to install a ruby gem. http://guides.rubygems.org/rubygems-basics/

update on how to install gem using the chefdk's ruby: I don't have a chefdk installed in a windows OS, but you should see the ruby installed by the chefdk here PATH_TO_chefdk/embedded/bin/ruby.

So, i just installed a chefdk on my win10 x64 (as its a friday :) )... And then to use the ruby from chefdk. follow this https://docs.chef.io/install_dk.html .. Refer to the "Powershell" section. But in short, just run chef shell-init powershell | Invoke-Expression in the PS console.

now you should be able to install the gem version. enter image description here

OK999
  • 1,353
  • 2
  • 19
  • 39
  • WARNING: You don't have c:\users\ravikiran\appdata\local\chefdk\gem\ruby\2.3.0\bin in your PATH, gem executables will not run. – one Aug 18 '17 at 19:22
  • You seem not have installed a system ruby. Use the chef ruby to install it. That means u have to navigate to the absolute path of that ruby installation.... – OK999 Aug 18 '17 at 19:29
  • see the updated answer for using the ruby that comes with the chefdk – OK999 Aug 18 '17 at 19:38
  • i tried command gem install test-kitchen -v1.15.0 You don't have c:\users\ravikiran\appdata\local\chefdk\gem\ruby\2.3.0\bin in your PATH, gem executables will not run. – one Aug 18 '17 at 20:43
  • did you do this? from my answer above, before executing that command??? just run `chef shell-init powershell | Invoke-Expression` in the PS console. – OK999 Aug 18 '17 at 20:48
0

Remove your ~/.chefdk folder, you probably tried to upgrade some gems in-place at some point. Wiping that out should get you back to baseline (if it doesn't, reinstall the ChefDK package too).

coderanger
  • 52,400
  • 4
  • 52
  • 75
  • on a different note & not that i care WARNINGS.. this is new, while trying to `chef verify`... `[WARN] This is an internal command used by the ChefDK development team. If you are a ChefDK user, please do not run it`. .. Been away from chef due to change in roles, but i haven't seen this line before – OK999 Aug 18 '17 at 20:15
  • ERROR: Running ["C:\Windows\System32\msiexec.exe" /i "C:\Users\ravikiran\AppData\Local\Temp\chocolatey\chefdk\1.2.22\chefdk-1.2.22-1-x86.msi" /qn /quiet /norestart ] was not successful. Exit code was '1603'. See log for possible error messages. Environment Vars (like PATH) have changed. Close/reopen your shell to see the changes (or in powershell/cmd.exe just type `refreshenv`). The install of chefdk was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\chefdk\tools\chocolateyinstall.ps1'. See log for details. – one Aug 22 '17 at 15:28