Why is Rspec saying “Failure/Error: Unable to find matching line from backtrace”?

后端 未结 11 1053
春和景丽
春和景丽 2020-12-03 02:35

I\'m following the rails tutorial here: http://railstutorial.org/chapters/filling-in-the-layout#top

When I run \"rspec spec/\", I get a bunch of errors that look lik

11条回答
  •  一向
    一向 (楼主)
    2020-12-03 03:15

    This is due to a bug in RSpec 2.0.0.beta.19. If you use 2.0.0.beta.18 as the tutorial suggests, it will work fine. Just change whatever version you have in your Gemfile to beta 18, bundle install and run the tests again.

    Here's the relevant parts from my Gemfile.

    group :development do
      gem 'rspec-rails', '2.0.0.beta.18'
    end
    
    group :test do
      gem 'rspec-rails', '2.0.0.beta.18'
      gem 'spork', '0.8.4'
    end
    

    Also note that Spork can also cause problems like this from time to time. If you get inexplicable test failures, especially if you just added new controllers or actions, go give spork a kick. Hit Ctrl-C and run the spork server again.

提交回复
热议问题