2014-04-19 40 views
0

我剛更新了我的寶石(包括rails到4.1)。我跑衛,一切正常。然後我創建了一個新模型並再次跑衛。這次在控制檯中一切看起來不錯,但警衛通知說Rspec results failed!我打開了新創建的模型的規格(其爲空),並保存它而不更改。然後在控制檯中,我可以看到以下錯誤:Rails Guard說'Rspec結果失敗',一個空規格給出依賴性錯誤

10:40:15 - INFO - Guard is now watching at '/home/pubudu/Projects/sumaga-asapuwa' 
    10:43:55 - INFO - Running: spec/models/dcache_spec.rb 
    /home/pubudu/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load': cannot load such file -- /home/pubudu/Projects/sumaga-asapuwa.bk/spec/models/dcache_spec.rb (LoadError) 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `block in load' 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency' 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load' 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `block in load_spec_files' 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `each' 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load_spec_files' 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:22:in `run' 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:80:in `run' 
     from /home/pubudu/.rvm/gems/ruby-2.1.1/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:17:in `block in autorun' 
     from /home/pubudu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
     from /home/pubudu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
     from -e:1:in `<main>' 
    [1] guard(main)> 

任何想法如何解決這個問題?

+1

請分享模型和規格文件。 –

+0

聽起來不像是空的;聽起來像它不存在(因此錯誤) – sevenseacat

回答

1

衛隊正在看目錄/home/pubudu/Projects/sumaga-asapuwa,但它正試圖在/home/pubudu/Projects/sumaga-asapuwa.bk/spec/models(即運行規範文件與文件夾名的額外.bk

在的rspec部分你Guardfile你應該有這樣一行:

watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } 

這是在指令來保護,如果根據應用程序目錄的變化的文件名爲.rb,或者被創建,以在相應的規格文件RSpec的運行,這被定義爲相對於所述目錄Guard是看。

+1

感謝它的工作!我刪除了另一個目錄,它工作:D – THpubs

+0

不用擔心。樂於幫助。 –

相關問題