我正在完成一些chefspec教程,并遇到了一个问题。
我的代码库有两本烹饪书,cookbookB是其他烹饪书使用的常用方法/库的集合。 CookbookA依赖于CookbookB,并将其定义为元数据。
配方按预期运行并达到预期效果。
在cookbookA上运行chef exec rspec spec
时收到此错误:
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
任何帮助都是值得赞赏的,因为到目前为止我的google-fu已经失败了。感谢。
答案 0 :(得分:1)
Berkshelf无法找到食谱sc_common
。这应该与ChefSpec无关,如果您运行berks install
,您应该会看到相同的错误。如果该菜谱在默认源中不可用,您可能需要为该菜谱指定显式来源。