Skip to content

Instantly share code, notes, and snippets.

@vinyar
Created January 6, 2015 11:17
Show Gist options
  • Save vinyar/24ac66c9fe723bc0427f to your computer and use it in GitHub Desktop.
Save vinyar/24ac66c9fe723bc0427f to your computer and use it in GitHub Desktop.
Chef verify failure on clean ChefDK installation on OSX 10.9.5
$ chef verify
Running verification for component 'berkshelf'
Running verification for component 'test-kitchen'
Running verification for component 'chef-client'
Running verification for component 'chef-dk'
Running verification for component 'chefspec'
....
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chefspec-4.2.0.beta.1/lib/chefspec/berkshelf.rb:4:in `rescue in <top (required)>': I could not load the 'Berkshelf' gem! You must have the gem installed (ChefSpec::Error::GemLoadError)
on your local system before you can use the berkshelf plugin.
You can install berkshelf by running:
gem install berkshelf
or add Berkshelf to your Gemfile and run the `bundle` command to install.
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chefspec-4.2.0.beta.1/lib/chefspec/berkshelf.rb:1:in `<top (required)>'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /private/var/folders/9r/g1wlns1j29bg0c7b_6fr7b480000gp/T/d20150106-75745-7a38qa/spec/spec_helper.rb:2:in `<top (required)>'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /private/var/folders/9r/g1wlns1j29bg0c7b_6fr7b480000gp/T/d20150106-75745-7a38qa/spec/foo_spec.rb:1:in `<top (required)>'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `load'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `block in load_spec_files'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `each'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `load_spec_files'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:96:in `setup'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:84:in `run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:69:in `run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:37:in `invoke'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/exe/rspec:4:in `<top (required)>'
from /opt/chefdk/embedded/bin/rspec:23:in `load'
from /opt/chefdk/embedded/bin/rspec:23:in `<main>'
---------------------------------------------
Verification of component 'chef-dk' succeeded.
Verification of component 'berkshelf' succeeded.
Verification of component 'chef-client' succeeded.
Verification of component 'chefspec' failed.
Verification of component 'test-kitchen' succeeded.
@vinyar
Copy link
Author

vinyar commented Jan 6, 2015

after removing the .chefdk folder and going through the uninstall steps on the docs page, followed by reinstalling chefdk again

$ be kitchen create
-----> Starting Kitchen (v1.3.0)
-----> Creating <default-win2012-chef11-14-2>...
       Bringing machine 'default' up with 'virtualbox' provider...
       The following berks command failed to execute:

           /Users/alexvinyar/.chefdk/gem/ruby/2.1.0/bin/berks --version --format json

       The stdout and stderr are shown below:

           stdout:
           stderr: /Applications/Vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'berkshelf' (>= 0) among 63 total gem(s) (Gem::LoadError)
        from /Applications/Vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
        from /Applications/Vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
        from /Users/alexvinyar/.chefdk/gem/ruby/2.1.0/bin/berks:22:in `<main>'
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider=virtualbox ----
STDOUT: Bringing machine 'default' up with 'virtualbox' provider...
STDERR: The following berks command failed to execute:

    /Users/alexvinyar/.chefdk/gem/ruby/2.1.0/bin/berks --version --format json

The stdout and stderr are shown below:

    stdout:
    stderr: /Applications/Vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'berkshelf' (>= 0) among 63 total gem(s) (Gem::LoadError)
    from /Applications/Vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /Applications/Vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /Users/alexvinyar/.chefdk/gem/ruby/2.1.0/bin/berks:22:in `<main>'
---- End output of vagrant up --no-provision --provider=virtualbox ----
Ran vagrant up --no-provision --provider=virtualbox returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

@vinyar
Copy link
Author

vinyar commented Jan 6, 2015

After removing vagrant plugins kitchen create and converge succeed.
However, chef verify still fails with the same error as originally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment