自动测试 - 加载错误 - 发布错误
bundle exec /Users/new2/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/bin/rspec --autotest '/Users/new2/work/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb'
/Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `require': no such file to load -- b (LoadError)
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `block in requires='
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `map'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `requires='
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:22:in `block in configure'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:21:in `each'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:21:in `configure'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:17:in `run'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in `run'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:10:in `block in autorun'
^CInterrupt a second time to quit
^C[sample_app (master)]$
就是上面的错误,一直在寻找。我的自动测试文件看起来不错。所有宝石均已安装。检查是否可以在其他地方找到问题,但没有成功。有什么想法吗?谢谢
bundle exec /Users/new2/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/bin/rspec --autotest '/Users/new2/work/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb'
/Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `require': no such file to load -- b (LoadError)
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `block in requires='
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `map'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration.rb:162:in `requires='
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:22:in `block in configure'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:21:in `each'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/configuration_options.rb:21:in `configure'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/command_line.rb:17:in `run'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:46:in `run'
from /Users/new2/.rvm/gems/ruby-1.9.2-p0@rails3tut/gems/rspec-core-2.0.1/lib/rspec/core/runner.rb:10:in `block in autorun'
^CInterrupt a second time to quit
^C[sample_app (master)]$
That's the error above, been looking around. My autotest file looks good. All gems are installed. Checked to see if I could find the problem elsewhere, but wasn't successful. Any ideas? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也有同样的错误。我最初认为这是一个拼写错误(在我的项目中,甚至是在 gem 源中随意制作的) - 但即使将所有内容重新安装到新的 rvm gemset 也没有修复任何问题。事实证明问题出在我的 .rspec 文件中:
错误:
正确:
双破折号非常必要;)
I had this same error. I initially assumed it was a typo (within my project or even haphazardly made within gem source) - but even reinstalling everything to a fresh rvm gemset didn't fix anything. Turns out the problem was in my .rspec file:
WRONG:
RIGHT:
The double dash is VERY necessary ;)
除非对代码片段进行编辑以删除真正缺失的库(这会适得其反),否则您的应用程序中的某个地方可能会出现拼写错误,最有可能在您的 Gemfile 中。您是否有类似于以下内容的台词:
那里的任何地方?如果是这样,如果您从示例代码中复制/粘贴,某些内容可能会被意外截断。
Unless the snippet was edited to remove the real missing library (which would be counter-productive) you have a typo somewhere in your app, most likely in your Gemfile. Do you have a line similar to:
Anywhere in there? If so, something might have been truncated accidentally if you were copy/pasting from the example code.
那是我的 Gemfile。
Thats my Gemfile.