遵循Michael Hartl的ROR教程,按照3.2测试中的说明完成这个奇怪的错误。 我运行命令:bundle exec rspec spec / requests / static_pages_spec.rb 我收到错误:
bundle exec rspec spec / requests / static_pages_spec.rb
/Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in load': no such file to load -- /Users/name/Desktop/ROR/sample-app/spec/requests/spec/requests/static_pages_spec.rb (LoadError)
from /Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in
块in load_spec_files'
来自/Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in map'
from /Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in
load_spec_files'
来自/Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in run'
from /Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in
run'
来自/Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in,clock in autorun'
任何帮助将不胜感激
答案 0 :(得分:0)
错误消息表明它正在/Users/name/Desktop/ROR/sample-app/*,em>spec/requests/spec/requests/*static_pages_spec.rb
尝试运行此命令时,您是否已在spec / requests /目录中?假设你在项目的主目录中;如果你已经在spec / requests /中,你可以运行:
bundle exec rspec static_pages_spec.rb