Ask Your Question
0

rake command issue

asked 2015-05-27 12:56:17 -0500

Chutki gravatar image

Hi,

below is my module for rspec-puppet testing

|-- manifests
|   `-- test_file.pp
|-- Rakefile
`-- spec
    |-- classes
    |-- defines
    |   `-- test_file_spec.rb
    |-- fixtures
    |   |-- manifests
    |   |   `-- site.pp
    |   `-- modules
    |       `-- test
    |           |-- files -> ../../../../files
    |           |-- lib -> ../../../../lib
    |           |-- manifests -> ../../../../manifests
    |           `-- templates -> ../../../../templates
    |-- functions
    |-- hosts
    `-- spec_helper.rb

the command rspec-puppet-initfailed, so I did manual set up from url http://rspec-puppet.com/setup/

but when I run "rake spec" getting error

(in /etc/puppetlabs/puppet/modules/offshore/test)
rake aborted!
no such file to load -- rspec/core/rake_task
/etc/puppetlabs/puppet/modules/offshore/test/Rakefile:2
(See full trace by running task with --trace)

when i run with "rake spec --trace" gettin below error

 rake aborted!
no such file to load -- rspec/core/rake_task
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/etc/puppetlabs/puppet/modules/offshore/test/Rakefile:2
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2382:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2382:in `raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2015:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1999:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1997:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

below is my /spec/defines/testfilespec.rb (i wrote)

require 'spec_helper'

describe 'test::test_file' do

end

some one please help me on this

edit retag flag offensive close merge delete

Comments

Can you provide the output of gem list?

Alex Harvey gravatar imageAlex Harvey ( 2015-05-27 21:05:34 -0500 )edit

# gem list *** LOCAL GEMS *** json (1.5.5) puppet-lint (0.3.2) rake (0.8.7) rspec-puppet (1.0.1)

Chutki gravatar imageChutki ( 2015-05-28 06:07:43 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-05-28 06:38:47 -0500

The code's failing because it can't find rspec/core/rake_task.rb, which is in rspec-core (3.2.3) for me, although I'm using rspec-puppet 2.1.0. So you're missing some gems.

edit flag offensive delete link more

Comments

Can some one help me what all are gems required for rspec-puppet testing I refrred pro-puppet second edition and http://rspec-puppet.com/ but no update about rspec-core gems

Chutki gravatar imageChutki ( 2015-05-28 11:58:38 -0500 )edit

Can you update your post to include the contents of your Gemfile. I'd like to understand why you have such an old version of rspec-puppet. When I install rspec-puppet, dependencies are installed.

Alex Harvey gravatar imageAlex Harvey ( 2015-05-28 19:50:29 -0500 )edit

$ bundle install ... Using rspec-support (3.2.2) Using rspec-core (3.2.3) Using rspec-expectations (3.2.1) Using rspec-mocks (3.2.1) Using rspec (3.2.0) Using rspec-puppet (2.1.0)

Alex Harvey gravatar imageAlex Harvey ( 2015-05-28 19:50:52 -0500 )edit

I installed all the required gems. Thanks Alex

Chutki gravatar imageChutki ( 2015-06-01 13:28:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-05-27 12:56:17 -0500

Seen: 531 times

Last updated: May 28 '15