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

Compass config.rb causing issues #753

Open
smallhadroncollider opened this issue Mar 22, 2016 · 3 comments
Open

Compass config.rb causing issues #753

smallhadroncollider opened this issue Mar 22, 2016 · 3 comments
Labels
Type: Bug Doesn't work as expected.

Comments

@smallhadroncollider
Copy link

When using ChefDK with Vagrant, if I have a Compass config.rb file in my project directory, Berks tries to read it and fails:

The following berks command failed to execute:

    /usr/local/bin/berks --version --format json

The stdout and stderr are shown below:

    stdout:
    stderr: /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/chef-config-12.7.2/lib/chef-config/workstation_config_loader.rb:159:in `rescue in read_config': You have an error in your config file /Volumes/Projects/ripetungi/saint-cooks/site/config.rb (ChefConfig::ConfigurationError)

LoadError: cannot load such file -- zen-grids
  /Volumes/Projects/ripetungi/saint-cooks/site/config.rb:13:in `from_string'
Relevant file content:
 12:
 13: require 'zen-grids'
 14:
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-config-12.7.2/lib/chef-config/workstation_config_loader.rb:138:in `read_config'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-config-12.7.2/lib/chef-config/workstation_config_loader.rb:73:in `load'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.4.2/lib/ridley/chef/config.rb:13:in `initialize'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf.rb:90:in `new'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf.rb:90:in `chef_config'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf/config.rb:80:in `<class:Config>'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf/config.rb:4:in `<module:Berkshelf>'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf/config.rb:3:in `<top (required)>'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf/cookbook_generator.rb:3:in `require_relative'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf/cookbook_generator.rb:3:in `<class:CookbookGenerator>'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf/cookbook_generator.rb:2:in `<module:Berkshelf>'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf/cookbook_generator.rb:1:in `<top (required)>'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf.rb:197:in `require_relative'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/lib/berkshelf.rb:197:in `<top (required)>'
        from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/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:55:in `require'
        from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.2.0/bin/berks:3:in `<top (required)>'
        from /usr/local/bin/berks:48:in `load'
        from /usr/local/bin/berks:48:in `<main>'


It appears that you are not using the ChefDK. Please note that Vagrant Berkshelf
works best when used with the ChefDK, and other installation methods are not
officially supported.

Please download and install the latest version of the ChefDK from:

    https://downloads.chef.io/chef-dk

and follow the installation instructions. Do not forget to add the ChefDK to
your PATH.

The file works fine with Compass and should just be ignored by Berks.

@cheeseplus
Copy link
Contributor

Berkshelf is using the chef libs to load knife.rb or config.rb, the latter being what we've been moving to slowly. I'm not sure if there is an elegant way around this if it's in the same dir in path of lookup but setting a config.json for Berks might avoid this entirely.

@coderanger
Copy link
Contributor

It should only look for .chef/config.rb though, might be an error in one of the loader systems.

@cheeseplus
Copy link
Contributor

Good to know - I'll label this as a bug in that case. I figured we just searched up directories until we found it like knife.rb of old.

@cheeseplus cheeseplus added the Type: Bug Doesn't work as expected. label Jul 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Doesn't work as expected.
Development

No branches or pull requests

3 participants