2013-11-26 32 views
2

我正在開發一個簡單的寶石,並計劃使用Guard來運行我的規格。但是,衛兵看起來並不知道路徑上的變化。守衛不知道文件更改

([email protected])[email protected]:~/avalancha/spree_mp$ bundle exec guard -d --watchdir /home/jperez/avalancha/spree_mp/ 
15:54:45 - DEBUG - Command execution: which notify-send 
15:54:45 - DEBUG - Command execution: emacsclient --eval '1' 2> /dev/null || echo 'N/A' 
15:54:45 - INFO - Guard is using NotifySend to send notifications. 
15:54:45 - INFO - Guard is using TerminalTitle to send notifications. 
15:54:45 - DEBUG - Command execution: hash stty 
15:54:45 - DEBUG - Guard starts all plugins 
15:54:45 - DEBUG - Hook :start_begin executed for Guard::RSpec 
15:54:45 - INFO - Guard::RSpec is running 
15:54:45 - INFO - Running all specs 
15:54:45 - DEBUG - Command execution: bundle exec rspec --help 
15:54:46 - DEBUG - Command execution: bundle exec rspec -f progress -r /home/jperez/.rvm/gems/[email protected]/gems/guard-rspec-2.5.4/lib/guard/rspec/formatter.rb -f Guard::RSpec::Formatter --failure-exit-code 2 spec 
No DRb server is running. Running in local process instead ... 
..FFFFFFFFF**FFFFFFFFFFFFFFFFFFFFFFF 

Pending: 
    # ... 
Failures: 

    #... 
Finished in 23.83 seconds 
36 examples, 32 failures, 2 pending 

Failed examples: 

# Some examples... 

15:55:13 - INFO - Guard is now watching at '/home/jperez/avalancha/spree_mp' 
15:55:13 - DEBUG - Start interactor 
[1] guard(main)> 

現在,如果我改變一個文件,沒有任何反應。雖然,如果我用手它守護通知,它做什麼,我希望:

[1] guard(main)> c app/models/spree_mercado_pago_client.rb 
Archivo modificado!!!! 
HOLA 
16:08:21 - DEBUG - Trying to run Guard::RSpec#run_on_modifications with ["spec/models/spree_mercado_pago_client_spec.rb"] 
16:08:21 - DEBUG - Hook :run_on_changes_begin executed for Guard::RSpec 
16:08:21 - INFO - Running: spec/models/spree_mercado_pago_client_spec.rb 
16:08:21 - DEBUG - Command execution: bundle exec rspec -f progress -r /home/jperez/.rvm/gems/[email protected]/gems/guard-rspec-2.5.4/lib/guard/rspec/formatter.rb -f Guard::RSpec::Formatter --failure-exit-code 2 spec/models/spree_mercado_pago_client_spec.rb 
No DRb server is running. Running in local process instead ... 
..FFFFFFFFF 

這裏是我的Guardfile

# A sample Guardfile 
# More info at https://github.com/guard/guard#readme 

guard 'rspec', all_after_pass:false do 
    watch(%r{.*}) do |m| 
    puts "Modified file!!!!" 
    end 


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

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

    watch(%r{^app/(.*)(\.erb|\.haml)$})     { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } 
    watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } 
    watch(%r{^spec/support/(.+)\.rb$})     { "spec" } 
    watch('config/routes.rb')       { "spec/routing" } 
    watch('app/controllers/application_controller.rb') { "spec/controllers" } 

    # Capybara features specs 
    watch(%r{^app/views/(.+)/.*\.(erb|haml)$})   { |m| "spec/features/#{m[1]}_spec.rb" } 

    # Turnip features and steps 
    watch(%r{^spec/acceptance/(.+)\.feature$}) 
    watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } 
end 

,這裏是我的Gemfile

source 'http://rubygems.org' 

gem 'spree', '~> 2.1.0' 
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-1-stable' 


group :test do 
    gem 'spork' 
    gem 'guard-rspec' 
    gem 'guard-spork' 
    gem 'capybara' 
end 

gemspec 

編輯:我在Ubuntu 12.10中運行這個問題

回答

0

問題似乎是在當前目錄中有一個到我的gemset的符號鏈接。

不清楚是因爲它是符號鏈接,還是因爲裏面有大量的文件。

+0

你能解釋一下嗎?我有同樣的問題。 – sunnyrjuneja

+0

@SunnyJuneja問題實際上是inotify的最大用戶手錶。試試https://github.com/guard/listen/issues/24 – geekazoid