Open xsunsmile opened 10 years ago
I get the same when running berks
in my Chef directory, using the latest version of buff-config (1.0.1
) and ruby (2.0.0p481 (2014-05-08 revision 45883)
.
Commenting out Ohai::Config[:plugin_path] << "/etc/chef/ohai_plugins"
in my .chef/knife.rb
resolves the issue.
/Library/Ruby/Gems/2.0.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:30:in `rescue in initialize': uninitialized constant Buff::Config::Ruby::Evaluator::Ohai (Buff::Errors::InvalidConfig)
from /Library/Ruby/Gems/2.0.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:25:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:17:in `new'
from /Library/Ruby/Gems/2.0.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:17:in `parse'
from /Library/Ruby/Gems/2.0.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:119:in `from_ruby'
from /Library/Ruby/Gems/2.0.0/gems/buff-config-1.0.1/lib/buff/config/ruby.rb:112:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/ridley-4.1.2/lib/ridley/chef/config.rb:83:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf.rb:90:in `new'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf.rb:90:in `chef_config'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf/config.rb:80:in `<class:Config>'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf/config.rb:4:in `<module:Berkshelf>'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf/config.rb:3:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf/cookbook_generator.rb:3:in `require_relative'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf/cookbook_generator.rb:3:in `<class:CookbookGenerator>'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf/cookbook_generator.rb:2:in `<module:Berkshelf>'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf/cookbook_generator.rb:1:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf.rb:197:in `require_relative'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf.rb:197:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/lib/berkshelf/cli.rb:1:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Library/Ruby/Gems/2.0.0/gems/berkshelf-3.2.3/bin/berks:3:in `<top (required)>'
from /usr/bin/berks:23:in `load'
from /usr/bin/berks:23:in `<main>'
same here, nasty error
any fix/workaround?
you might be able to wrap your own code with:
if defined?(Ohai::Config)
...
end
berks/ridley/buff-config does not have any idea what Ohai::Config is.
this is a problem with using .rb files for config and then having multiple different contexts that parse the config file.
if it was a json file this couldn't happen, but you'd lose the flexibility that you're losing.
I got an exception when using
I have these extra lines in my /etc/chef/client.rb
Here is the stacktrace