I have some chef unit tests that I can run via the command : chef exec rspec
However, I am trying to run these from TeamCity and I am using a rakefile. When I try to execute the rakefile the require 'chefspec' line in the test file causes an error "cannot load such file -- chefspec (LoadError)"
I know chefspec is installed. I am new to Ruby, chefspec, rspec. I know there is mention of a gemspec file and I have tried to create one in the directory where I can run the command chef exec rspec
to execute the test. However, when I try to run bundle install
I get the error Could not locate Gemfile or .bundle/ directory
. Is there a default location of a gemfile when you install ruby? I am pretty lost at this point.
C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
require': cannot load such file -- chefspec (LoadErr
or)
from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require'
from D:/../spec/octopus_tentacle_spec.rb:1:in
'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1327:in load'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1327:in
block in load_
spec_files'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1325:in each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1325:in
load_spec_file
s'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:102:in setup'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:88:in
run'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in run'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in
invoke'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rspec-core-3.3.2/exe/rspec:4:in <top (required)>'
from C:/Ruby22/bin/rspec:23:in
load'
from C:/Ruby22/bin/rspec:23:in <main>'