0

按照 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:在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/Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780 中的 load_spec_files' 块中:在 load_spec_files map' from /Users/name/.rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in' 中/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:inrun' 来自 /Users/name/。 rvm/gems/ruby-1.9.2-p320/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'

任何帮助,将不胜感激

4

1 回答 1

0

错误消息表明它正在 /Users/name/Desktop/ROR/sample-app/* spec/requests/spec/requests/ *static_pages_spec.rb中查找文件

尝试运行此命令时,您是否已经在 spec/requests/ 目录中?假设您在项目的主目录中;如果你已经在 spec/requests/ 中,你可以运行:

bundle exec rspec static_pages_spec.rb

于 2013-06-21T20:28:18.960 回答