rspec 3.0.1在测试用例中不工作

rspec 3.0.1在测试用例中不工作,rspec,Rspec,我有一个~/Projects文件夹,其中包含以下文件: bowling.rb和bowling_spec.rb 为了测试gem,这两个文件与rspec的索引页()中描述的文件相同 当我尝试执行bowling_spec.rb时,我收到以下消息: ak@ak-ku:~/Projects$ rspec bowling_spec.rb /home/ak/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kerne

我有一个~/Projects文件夹,其中包含以下文件:

bowling.rb和bowling_spec.rb

为了测试gem,这两个文件与rspec的索引页()中描述的文件相同

当我尝试执行bowling_spec.rb时,我收到以下消息:

ak@ak-ku:~/Projects$ rspec bowling_spec.rb 
/home/ak/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bowling (LoadError)
    from /home/ak/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/ak/Projects/bowling_spec.rb:1:in `<top (required)>'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in `load'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in `block in load_spec_files'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in `each'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in `load_spec_files'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:97:in `setup'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:85:in `run'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:70:in `run'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:38:in `invoke'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/exe/rspec:4:in `<top (required)>'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/bin/rspec:23:in `load'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/bin/rspec:23:in `<main>'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in `eval'
    from /home/ak/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in `<main>'
ak@ak-ku:~/Projects$rspec bowling\u spec.rb
/home/ak/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:55:“require”中:无法加载此类文件--bowling(LoadError)
from/home/ak/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site\u ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'
from/home/ak/Projects/bowling_spec.rb:1:in`'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in'load'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:“加载规范文件中的块”
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:in'each'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/configuration.rb:1051:“加载规范文件”
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:97:in'setup'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:85:in'run'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:70:in'run'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:38:in“invoke”
from/home/ak/.rvm/gems/ruby-2.0.0-p481/gems/rspec-core-3.0.1/exe/rspec:4:in`'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/bin/rspec:23:in'load'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/bin/rspec:23:in`'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/bin/ruby\u executable\u hooks:15:in'eval'
from/home/ak/.rvm/gems/ruby-2.0.0-p481/bin/ruby\u executable\u hooks:15:in`'
我能做些什么?为什么这不起作用


我在Kubuntu的RVM1.25.27下使用ruby 2.0.0p481。Rails是4.1.1版本,我今天安装了所有内容。

可能重复的错误虽然有点不同,但答案如下:另外,RSpec 3.0.1也记录在这里。rspec.info用于rspec 1。