Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

berks not working on OS X after upgrading to 0.10.0-1 #657

Closed
pkyeck opened this issue Jan 27, 2016 · 7 comments
Closed

berks not working on OS X after upgrading to 0.10.0-1 #657

pkyeck opened this issue Jan 27, 2016 · 7 comments

Comments

@pkyeck
Copy link

pkyeck commented Jan 27, 2016

I followed these steps to uninstall v0.4.0 + also removed the ~/.chefdk folder.
But after installing the v0.10.0-1 I get the following error when trying to berks --version:

$ berks --version
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/webagent-cookie.rb:458: warning: already initialized constant HTTPClient::CookieManager
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.6.0.1/lib/httpclient/cookie.rb:8: warning: previous definition of CookieManager was here
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:30:in `rescue in initialize': uninitialized constant Buff::Config::Ruby::Evaluator::Chef (Buff::Errors::InvalidConfig)
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:25:in `initialize'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:17:in `new'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:17:in `parse'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:119:in `from_ruby'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:112:in `initialize'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.3.2/lib/ridley/chef/config.rb:83:in `initialize'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf.rb:90:in `new'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf.rb:90:in `chef_config'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf/config.rb:80:in `<class:Config>'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf/config.rb:4:in `<module:Berkshelf>'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf/config.rb:3:in `<top (required)>'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf/cookbook_generator.rb:3:in `require_relative'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf/cookbook_generator.rb:3:in `<class:CookbookGenerator>'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf/cookbook_generator.rb:2:in `<module:Berkshelf>'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf/cookbook_generator.rb:1:in `<top (required)>'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf.rb:197:in `require_relative'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf.rb:197: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 /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/lib/berkshelf/cli.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 /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.0.1/bin/berks:3:in `<top (required)>'
    from /opt/chefdk/bin/berks:42:in `load'
    from /opt/chefdk/bin/berks:42:in `<main>'

@mgdevstack also mentions the same error in #597.
A bit frustrated that there is not a "safe" way of updating the chefdk :(

@brandocorp
Copy link
Contributor

Do you happen to have a config file under ~/.berkshelf/config.json ?

@pkyeck
Copy link
Author

pkyeck commented Jan 27, 2016

nope, but a couple of folders:

drwxr-xr-x   6 phil  staff   204B 11 Mai  2015 ./
drwxr-xr-x+ 58 phil  staff   1,9K 27 Jan 21:31 ../
drwxr-xr-x   3 phil  staff   102B 24 Feb  2015 .cache/
drwxr-xr-x  97 phil  staff   3,2K 27 Jan 20:31 cookbooks/
drwxr-xr-x   3 phil  staff   102B 11 Mai  2015 knife-solo/
drwxr-xr-x   3 phil  staff   102B 17 Feb  2015 vagrant-berkshelf/

@warden1975
Copy link

same here...

@brandocorp
Copy link
Contributor

Ok, after taking a closer look at the stack trace, it appears that Berkshelf via Ridley via buff-config doesn't like your knife configuration file.

https://github.com/berkshelf/ridley/blob/v4.3.2/lib/ridley/chef/config.rb#L12-L31
https://github.com/reset/buff-config/blob/v1.0.1/lib/buff/config/ruby.rb#L30

Based on the error it seems to be finding a reference to the Chef class in your config.

@danielsdeleo
Copy link
Contributor

@pkyeck can you confirm this hypothesis?

@pkyeck
Copy link
Author

pkyeck commented Jan 28, 2016

yes, that was the culprit. commenting that out fixes the problem and everything is working again.

thanks for the support.

@danielsdeleo
Copy link
Contributor

Probably worth filing a bug with berks about making this error case more clear. But I'm closing here since that's not really relevant to ChefDK

@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants