2

我正在关注 Hartl 的 Ruby on Rails 指南,我目前正在尝试设置“guard”和“spork”来自动化“rspec”测试。当我尝试跑步时 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'

我为有类似问题的人查看了其他解决方案(例如重新安装 gems、使用绝对路径和修复目标文件中的 do/end 语句),但似乎没有一个解决方案能改变问题。谢谢你的帮助!

4

3 回答 3

1

重写你的 Gemfile。将 'selenium-webdriver' 更改为 '~> 2.35.1',重新安装 bundle,一切正常!

于 2013-08-30T10:57:43.100 回答
0

当我使用相同的教程研究相同的问题时,这个页面出现了。经过一些额外的调查,我发现我在 --drb 选项上只输入了一个破折号。使用单个破折号 rspec 启用调试并尝试要求文件“b”。与连接到 DRb 服务器非常不同:-

于 2014-02-25T15:49:05.887 回答
0

尝试在参数中使用单个破折号运行测试时遇到了同样的错误(需要使用 --rdb 运行)。

于 2013-05-28T09:56:14.160 回答