I'm working through a few chefspec tutorials and have come up against an issue.
My codebase has a two cookbooks in, with cookbookB being a collection of common methods/libraries that are used by other cookbooks. CookbookA depends on CookbookB and has this defined it the metadata.
The recipes run as intended and achieve the desired result.
When running chef exec rspec spec
on cookbookA I receive this error:
C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.5/lib/berkshelf/resolver.rb:85:in `rescue in resolve': Unable to satisfy constraints on packag
e sc_common, which does not exist, due to solution constraint (steve-solr = 0.1.1). Solution constraints that may result in a constraint on sc_common: [(steve-s
olr = 0.1.1) -> (sc_common >= 0.0.0)] (Berkshelf::NoSolutionError)
Missing artifacts: sc_common
Demand that cannot be met: (steve-solr = 0.1.1)
Unable to find a solution for demands: steve-solr (0.1.1)
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.5/lib/berkshelf/resolver.rb:75:in `resolve'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.5/lib/berkshelf/installer.rb:175:in `install_from_universe'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.5/lib/berkshelf/installer.rb:39:in `run'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.5/lib/berkshelf/berksfile.rb:421:in `install'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.5/lib/berkshelf/berksfile.rb:630:in `block in vendor'
from C:/opscode/chefdk/embedded/lib/ruby/2.1.0/tmpdir.rb:88:in `mktmpdir'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.5/lib/berkshelf/berksfile.rb:628:in `vendor'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chefspec-4.7.0/lib/chefspec/berkshelf.rb:39:in `block in setup!'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/shell/basic.rb:20:in `mute'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chefspec-4.7.0/lib/chefspec/berkshelf.rb:35:in `setup!'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chefspec-4.7.0/lib/chefspec/berkshelf.rb:61:in `block (2 levels) in <top (required)>'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/example.rb:425:in `instance_exec'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/example.rb:425:in `instance_exec'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/hooks.rb:357:in `run'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1724:in `block in run_hooks_with'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1724:in `each'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1724:in `run_hooks_with'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1679:in `with_suite_hooks'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:118:in `block in run_specs'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:77:in `report'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:117:in `run_specs'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:93:in `run'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
from C:/Users/Steve/AppData/Local/chefdk/gem/ruby/2.1.0/bin/rspec:22:in `load'
from C:/Users/Steve/AppData/Local/chefdk/gem/ruby/2.1.0/bin/rspec:22:in `<main>'
PS C:\Users\steve\Dev\steve-solr-restartcores\chef-repos\chef-test\cookbooks\steve-solr> chef exec rspec spec
C:/opscode/chefdk/embedded/lib/ruby/2.1.0/i386-mingw32/dl.so: warning: already initialized constant DL::RUBY_FREE
C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/net-ssh-3.1.1/lib/net/ssh/authentication/pageant.rb:16: warning: previous definition of RUBY_FREE was here
DL is deprecated, please use Fiddle
Any help is appreciated as so far my google-fu has failed me. thanks.
The cookbook sc_common
is not findable from Berkshelf. This shouldn't be related to ChefSpec specifically, if you run berks install
you should see the same error. You probably need to specify an explicit source for that cookbook if it isn't available in your default source(s).