轨; shoulda-matchers突然发出未初始化的常量错误

时间:2016-04-19 15:56:15

标签: ruby-on-rails rspec shoulda

正如您在规范文件中看到的第一次和第二次节省之间〜15秒一样。第一次保存后,由于输入错误我得到错误,然后在第二次保存后突然我开始获得uninitialized constant: Shoulda (NameError)

从那时起,我每次保存后都会收到此错误。在此问题出现之前一切正常。

为什么会这样?

16:15:03 - INFO - Running: spec/controllers/tasks_controller_spec.rb
Running via Spring preloader in process 91917
/Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load': /Users/Silo/Desktop/ruby_on_rails/faskyn/spec/controllers/tasks_controller_spec.rb:8: syntax error, unexpected '{', expecting ')' (SyntaxError)
    let(:executed_task { create(:task, executor: user) }
                        ^
/Users/Silo/Desktop/ruby_on_rails/faskyn/spec/controllers/tasks_controller_spec.rb:8: syntax error, unexpected '}', expecting keyword_end
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
    from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'
16:15:04 - ERROR - Failed: "spring rspec -f progress -r /Users/Silo/.rvm/gems/ruby-2.2.3/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/controllers/tasks_controller_spec.rb" (exit code: 1)

16:15:17 - INFO - Running: spec/controllers/tasks_controller_spec.rb
Running via Spring preloader in process 91930
/Users/Silo/Desktop/ruby_on_rails/faskyn/spec/rails_helper.rb:16:in `<top (required)>': uninitialized constant Shoulda (NameError)
    from /Users/Silo/Desktop/ruby_on_rails/faskyn/spec/controllers/tasks_controller_spec.rb:1:in `<top (required)>'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
    from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'
16:15:20 - ERROR - Failed: "spring rspec -f progress -r /Users/Silo/.rvm/gems/ruby-2.2.3/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/controllers/tasks_controller_spec.rb" (exit code: 1)

16:15:43 - INFO - Running: spec/controllers/tasks_controller_spec.rb
Running via Spring preloader in process 91941
/Users/Silo/Desktop/ruby_on_rails/faskyn/spec/rails_helper.rb:16:in `<top (required)>': uninitialized constant Shoulda (NameError)
    from /Users/Silo/Desktop/ruby_on_rails/faskyn/spec/controllers/tasks_controller_spec.rb:1:in `<top (required)>'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
    from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'
16:15:45 - ERROR - Failed: "spring rspec -f progress -r /Users/Silo/.rvm/gems/ruby-2.2.3/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/controllers/tasks_controller_spec.rb" (exit code: 1)

16:16:39 - INFO - Running: spec/models/conversation_spec.rb
Running via Spring preloader in process 91963
/Users/Silo/Desktop/ruby_on_rails/faskyn/spec/rails_helper.rb:16:in `<top (required)>': uninitialized constant Shoulda (NameError)
    from /Users/Silo/Desktop/ruby_on_rails/faskyn/spec/models/conversation_spec.rb:1:in `<top (required)>'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
    from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
    from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'
16:16:41 - ERROR - Failed: "spring rspec -f progress -r /Users/Silo/.rvm/gems/ruby-2.2.3/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/models/conversation_spec.rb" (exit code: 1)

0 个答案:

没有答案