Forum: RSpec Strange error when running bundle exec rspec spec

47e90aff63339b93872ddf8431dfc35c?d=identicon&s=25 Bradley Symons (snomys)
on 2012-04-04 22:32
Hi

I have been following the online rails tutorial written by Micheal
Hartl, can be found here:

http://ruby.railstutorial.org/chapters/beginning#top

As I have been going through the chapters, at first the rspec tests were
running completely fine. One of the chapters suggests installing
blueprint stylesheet, which I did.

Somewhere after that, when I write rspec tests and run bundle exec rspec
spec, it all broke.

The followiung error is displaying in the stack trace, but I have no
idea why its pointing to the cucumber steps, and an undefined method
'When'.

Im completely lost with this. Any help very much appreciated.

I have installed the cucumber gem, and tried a few other things, but as
of now, I have no ability to run rspec. :(


C:/Users/brad/rails_projects/hartl_tutorial/sample_app/app/assets/stylesheets/joshuaclayton-blueprint-css-9bf9513/features/step_definitions/blueprint_steps.rb:1:in
`<top (required)>': undefined method `When' for main:Object
(NoMethodError)
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
`require'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
`block in require'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in
`load_dependency'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in
`require'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:348:in
`require_or_load'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:302:in
`depend_on'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:214:in
`require_dependency'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:417:in
`block (2 levels) in eager_load!'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:416:in
`each'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:416:in
`block in eager_load!'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:414:in
`each'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:414:in
`eager_load!'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application/finisher.rb:51:in
`block in <module:Finisher>'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in
`instance_exec'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in
`run'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:55:in
`block in run_initializers'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in
`each'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in
`run_initializers'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:96:in
`initialize!'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in
`method_missing'
        from
C:/Users/brad/rails_projects/hartl_tutorial/sample_app/config/environment.rb:5:in
`<top (required)>'
        from
C:/Users/brad/rails_projects/hartl_tutorial/sample_app/spec/spec_helper.rb:3:in
`require'
        from
C:/Users/brad/rails_projects/hartl_tutorial/sample_app/spec/spec_helper.rb:3:in
`<top (required)>'
        from
C:/Users/brad/rails_projects/hartl_tutorial/sample_app/spec/controllers/pages_controller_spec.rb:1:in
`require'
        from
C:/Users/brad/rails_projects/hartl_tutorial/sample_app/spec/controllers/pages_controller_spec.rb:1:in
`<top (required)>'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in
`load'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in
`block in load_spec_files'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in
`map'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in
`load_spec_files'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:in
`run'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in
`run_in_process'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in
`run'
        from
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in
`block in autorun'

C:\Users\brad\rails_projects\hartl_tutorial\sample_app>
198eb566b88e2693b2e3718b65b89385?d=identicon&s=25 fox daivsm (fox_daivsm)
on 2012-07-25 09:31
I ran into this today but I presume snomys got through it. For others
whom may encounter:

Remove both the 'features' and 'lib' directories supplied with the
blueprint-css folder.

rm -r app/assets/stylesheets/*blueprint-css-*/{features,lib}/

Not a professional but I couldn't see the use for either in this portion
of the hierarchy.
This topic is locked and can not be replied to.