我正在接受一个我一年没有工作过的项目。当我尝试运行rspec时,我收到此错误消息
/home/andreas/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `require':
cannot load such file -- rspec/rails/extensions/active_record/base (LoadError)
我在运行
后收到此消息bundle exec rspec
它是在迁移执行后发生的
andreas@ofelia ~/w/sl2> rails -v
Rails 4.1.9
andreas@ofelia ~/w/sl2> rspec -v
3.5.4
andreas@ofelia ~/w/sl2> ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
andreas@ofelia ~/w/sl2> which gem activesupport
/home/andreas/.rvm/rubies/ruby-2.1.1/bin/gem
andreas@ofelia ~/w/sl2> which gem active_record
/home/andreas/.rvm/rubies/ruby-2.1.1/bin/gem
andreas@ofelia ~/w/sl2> gem list | grep activerecord
activerecord (4.1.9, 4.1.1, 4.1.0, 4.0.3, 4.0.0, 3.0.10)
activerecord-deprecated_finders (1.0.3)
解决方案
这是一个rspec版本的问题。我不记得测试是用rspec 2进行的。希望有人能从中学到一些东西