加载运行rspec的错误

时间:2011-09-15 22:23:25

标签: ruby ruby-on-rails-3 rspec2

我试图运行Rails 3.0和Ruby 1.9.2并运行我刚刚下载的Rspec 2.6.0。当我尝试运行Rspec时,收到以下错误消息:

 Paul-Denlingers-MacBook-Pro:spec pdenlinger$ rspec spec
 No DRb server is running. Running in local process instead ...
 /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-     2.6.4/lib/rspec/core/configuration.rb:419:in `load':    
 no such file to load --       /Users/pdenlinger/rails3inaction/things_i_bought/bacon/spec/spec (LoadError)
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-   2.6.4/lib/rspec/core/configuration.rb:419:in 
`block in load_spec_files'
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:
 in `map'
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:
 in `load_spec_files'
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:
 in `run'
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:
 in `run_in_process'
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:66:
 in `rescue in run'
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:62:
 in `run'
from /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:
  in `block in autorun'

很抱歉代码格式问题;有些线条不会调整。

我需要做些什么来解决这个问题?

2 个答案:

答案 0 :(得分:4)

您告诉rspec搜索spec目录,然后获取所有规格。如果您已经在spec目录中,它将失败,因此您必须运行rspec .或进入应用的根目录并从那里运行rspec spec

答案 1 :(得分:1)

Paul-Denlingers-MacBook-Pro:spec pdenlinger $ bundle exec rspec