Brad Symons
2012-Apr-04 20:32 UTC
[rspec-users] Strange error when running bundle exec rspec spec
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>
--
Posted via http://www.ruby-forum.com/.
Cynthia Kiser
2012-Apr-04 20:41 UTC
[rspec-users] Strange error when running bundle exec rspec spec
Quoting Brad Symons <lists at ruby-forum.com>:> 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''.Is the error below happening when you run the rake task or try to run individual specs? e.g. when you run ''rake spec''? or when you run ''spec spec/controllers/some_controller_spec.rb'' And why is that path so odd? How did you get feature files INSIDE the app/assets directory? I don''t think that is where they belong so I would move them back to C:/Users/brad/rails_projects/hartl_tutorial/sample_app/features/... Or delete them if you still have the original copies of them in the normal place.> 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-- Cynthia N. Kiser cnk at ugcs.caltech.edu
fox daivsm
2012-Jul-25 07:31 UTC
[rspec-users] Strange error when running bundle exec rspec spec
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.
--
Posted via http://www.ruby-forum.com/.