自动测试 - 加载错误 - 发布错误

发布于 2024-09-28 13:47:53 字数 1881 浏览 2 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

最美的太阳 2024-10-05 13:47:53

我也有同样的错误。我最初认为这是一个拼写错误(在我的项目中,甚至是在 gem 源中随意制作的) - 但即使将所有内容重新安装到新的 rvm gemset 也没有修复任何问题。事实证明问题出在我的 .rspec 文件中:

错误:

-drb

正确:

--drb

双破折号非常必要;)

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:

-drb

RIGHT:

--drb

The double dash is VERY necessary ;)

灼痛 2024-10-05 13:47:53

除非对代码片段进行编辑以删除真正缺失的库(这会适得其反),否则您的应用程序中的某个地方可能会出现拼写错误,最有可能在您的 Gemfile 中。您是否有类似于以下内容的台词:

gem 'b'

那里的任何地方?如果是这样,如果您从示例代码中复制/粘贴,某些内容可能会被意外截断。

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:

gem 'b'

Anywhere in there? If so, something might have been truncated accidentally if you were copy/pasting from the example code.

一个人的夜不怕黑 2024-10-05 13:47:53
source 'http://rubygems.org'

gem 'rails', '3.0.0'

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

group :development do
 gem 'rspec-rails', '2.0.1'
end

group :test do
  gem 'rspec', '2.0.1'
  gem 'spork', '0.8.4'
end

那是我的 Gemfile。

source 'http://rubygems.org'

gem 'rails', '3.0.0'

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

group :development do
 gem 'rspec-rails', '2.0.1'
end

group :test do
  gem 'rspec', '2.0.1'
  gem 'spork', '0.8.4'
end

Thats my Gemfile.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文