我正在关注Hartl的Ruby on Rails指南,我正在尝试为自动“rspec”测试设置“后卫”和“spork”。当我试图跑
bundle exec rspec spec/requests/static_pages_spec.rb
我收到以下错误:
/home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `require': cannot load such file -- b (LoadError)
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `block in requires='
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `map'
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `requires='
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:20:in `block in configure'
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:19:in `each'
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:19:in `configure'
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:21:in `run'
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
from /home/throne/.rvm/gems/ruby-1.9.3-p392@rails3tutorial2ndEd/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
我为那些有类似问题的人(重新安装宝石,使用绝对路径和修复目标文件中的do / end语句等)查看了其他解决方案,但是他们似乎都没有改变这个问题。谢谢你的帮助!
答案 0 :(得分:1)
重写你的Gemfile。将'selenium-webdriver'改为'〜> 2.35.1',重新安装捆绑包,一切都必须好!
答案 1 :(得分:0)
尝试使用params中的单个破折号运行测试时遇到同样的错误(需要使用--rdb运行)。
答案 2 :(得分:0)
当我使用相同的教程研究相同的问题时,出现了这个页面。经过一些额外的调查,我发现我在--drb选项上只输入了一个破折号。使用单个短划线rspec启用调试并尝试要求文件'b'。与连接到DRb服务器非常不同: -