我试图运行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'
很抱歉代码格式问题;有些线条不会调整。
我需要做些什么来解决这个问题?
答案 0 :(得分:4)
您告诉rspec
搜索spec
目录,然后获取所有规格。如果您已经在spec
目录中,它将失败,因此您必须运行rspec .
或进入应用的根目录并从那里运行rspec spec
。
答案 1 :(得分:1)
Paul-Denlingers-MacBook-Pro:spec pdenlinger $ bundle exec rspec