chef / chef-vault-testfixtures

provides an RSpec shared context for testing Chef cookbooks that use chef-vault
Apache License 2.0
7 stars 10 forks source link

Weird error when running rspec #22

Closed JoeTalbot closed 7 years ago

JoeTalbot commented 8 years ago

When running rspec, i get cannot load such file --chef-vault/test-fixtures

here is some info:

$ ruby --version
ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-darwin13.0]
$ which ruby
/opt/chefdk/embedded/bin/ruby
$ rspec
/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- chef-vault/test-fixtures (LoadError)
    from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /drone/src/spec/spec_helper.rb:5: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 /drone/src/spec/unit/recipes/default_spec.rb:7:in `<top (required)>'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `load'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
    from /opt/chefdk/embedded/bin/rspec:22:in `load'
    from /opt/chefdk/embedded/bin/rspec:22:in `<main>'

The weird part is i can run this from my local machine (mac osx 10.11.3) and it works just fine, but when i am running this with drone, and inside a docker container i get this error. Im not sure what i am missing??

micmicsuarez commented 8 years ago

hi @JoeTalbot, it means that the chef-vault-testfixtures was not installed in your local machine. In order to fix the bad issue, you need to install it.

Just execute this command:

chef gem install chef-vault-testfixtures

I used that command above to fixed my issue here. Thanks :

thommay commented 7 years ago

The advice here is sound. ensure that chef-vault-testfixtures is installed using chef gem directly or by shipping a Gemfile and using bundler.