我是Ruby on Rails的新手。我刚开始学习Michael Hartl (klick)的RoR教程。我在5.2.1,我们在这里学习Integration_tests。
当我运行rails generate integration_test layout_links时,它会生成rspec文件,但当运行rspec spec时,我会得到:
You have already activated rspec-core 2.6.3, but your Gemfile requires rspec-core 2.x.x和所有测试都会失败。
如果我稍微玩玩,我就会得到SystemStackError:stack level too deep,所有的测试都会失败。
可能我的Gemsets搞砸了,或者我需要运行另一个版本的rspec-rails。
我的Gemfile.lock的一部分看起来像:
rake (0.9.1)
rb-fsevent (0.4.0)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.3)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (2.0.0.beta.18)
rspec (>= 2.0.0.beta.14)
webrat (>= 0.7.0)
sqlite3 (1.3.3)
thor (0.14.6)编辑:已解决。我将rspec-rails版本改为2.6.1,并将'webrat‘添加到:development和:test gem集。就像一个护身符..。:-)
发布于 2011-06-03 07:00:06
这通常可以通过执行bundle exec rspec spec而不只是rspec spec来解决
https://stackoverflow.com/questions/6221012
复制相似问题