Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rspec未在应用程序上运行_Ruby On Rails_Ruby On Rails 3_Unit Testing_Rspec_Tdd - Fatal编程技术网

Ruby on rails Rspec未在应用程序上运行

Ruby on rails Rspec未在应用程序上运行,ruby-on-rails,ruby-on-rails-3,unit-testing,rspec,tdd,Ruby On Rails,Ruby On Rails 3,Unit Testing,Rspec,Tdd,好的,我是一名RubyonRails开发人员,我即将开始尝试使用TDD(测试驱动开发)方法,我不确定我做错了什么。我有一个现有的应用程序,已经有一些rpec测试,我正试图找出如何运行它们,但当我这样做 rake spec (in /Users/tamer/Sites/preview) /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_miss

好的,我是一名RubyonRails开发人员,我即将开始尝试使用TDD(测试驱动开发)方法,我不确定我做错了什么。我有一个现有的应用程序,已经有一些rpec测试,我正试图找出如何运行它们,但当我这样做

rake spec
(in /Users/tamer/Sites/preview)
/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing_from_s3_library': uninitialized constant PreviewsController (NameError)
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/backward_compatibility.rb:20:in `const_missing'
    from /Users/tamer/Sites/preview/spec/controllers/previews_controller_spec.rb:3:in `<top (required)>'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `block in load_spec_files'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `map'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load_spec_files'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:18:in `run'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in `run_in_process'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in `run'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `block in autorun'
rake aborted!

(See full trace by running task with --trace)
rake规范
(在/Users/tamer/Sites/preview中)
/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in'const_missing_from_s3_library':未初始化常量PreviewController(NameError)
来自/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/backward_兼容性。rb:20:in'const_missing'
from/Users/tamer/Sites/preview/spec/controllers/previews\u controller\u spec.rb:3:in`'
来自/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in'block in load_spec_files'
来自/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in'map'
来自/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:在“加载规范文件”中
来自/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/command_-line.rb:18:in'run'
来自/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in'run_in_进程'
来自/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in'run'
来自/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in'block in autorun'
雷克流产了!
(通过使用--trace运行任务查看完整跟踪)

是否有我遗漏的东西,以及我需要做些什么才能让以前的测试运行

错误是不言自明的

uninitialized constant PreviewsController (NameError)
/spec/controllers/previews\u controller\u spec.rb
引用的
PreviewsController
类可能不再存在于
/app/controllers


如果相应的控制器已被删除,则更新规范或将其删除。

该错误是不言自明的

uninitialized constant PreviewsController (NameError)
/spec/controllers/previews\u controller\u spec.rb
引用的
PreviewsController
类可能不再存在于
/app/controllers

更新等级库或删除等级库(如果已删除相应的控制器)