Ruby on rails guard rspec未检测到更改

Ruby on rails guard rspec未检测到更改,ruby-on-rails,ruby,rspec,guard,Ruby On Rails,Ruby,Rspec,Guard,我是RoR的新手,遵循Michael Hartly的Ruby教程,在设置guard rspec之后,它不会检测到正在监视的文件的更改。我到处搜寻,没有一个答案适用于我(除非我不理解某些东西——这太可能了)。其他一切似乎都起作用了 我正在运行Windows 8,并已将其设置为在Sublime Text 2中显示测试结果。我在启动Guard时收到两个通知,显示我所有测试的RSpec结果,但这似乎是我最后一次看到它。我可以运行所有测试,但在更改监视的文件时它不会运行 我正在更改的文件位于C:\Site

我是RoR的新手,遵循Michael Hartly的Ruby教程,在设置guard rspec之后,它不会检测到正在监视的文件的更改。我到处搜寻,没有一个答案适用于我(除非我不理解某些东西——这太可能了)。其他一切似乎都起作用了

我正在运行Windows 8,并已将其设置为在Sublime Text 2中显示测试结果。我在启动Guard时收到两个通知,显示我所有测试的RSpec结果,但这似乎是我最后一次看到它。我可以运行所有测试,但在更改监视的文件时它不会运行

我正在更改的文件位于C:\Sites\demo\app\views\static\u页面中,\demo是我的rails应用程序的根目录

我已在下面附上我的Gem文件和Guardfile。如果还有其他需要解决的问题,请告诉我。我希望我没有给太多或太少的信息,但我真的是湿了耳朵后面!谢谢

档案:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.11.0'
  gem 'guard-rspec', '1.2.1'
  gem 'guard-spork', '1.2.0'
  gem 'childprocess', '0.3.6'
  gem 'spork', '0.9.2'
  gem 'listen'

end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.2'

# Test gems on Windows
group :test do
  gem 'capybara', '1.1.2'
  gem 'rb-fchange', '0.0.5'
  gem 'rb-notifu', '0.0.4'
  gem 'win32console', '1.3.0'
end

group :production do
  gem 'pg', '0.12.2'
end
警卫文件:

require 'active_support/core_ext'

guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' } do
  watch('config/application.rb')
  watch('config/environment.rb')
  watch(%r{^config/environments/.+\.rb$})
  watch(%r{^config/initializers/.+\.rb$})
  watch('Gemfile')
  watch('Gemfile.lock')
  watch('spec/spec_helper.rb')
  watch('test/test_helper.rb')
  watch('spec/support/')
end

    guard 'rspec', :version => 2, :all_after_pass => false, :cli => '--drb' do


      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$})                           { |m| "spec/#{m[1]}_spec.rb" }
      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 request specs
      watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/requests/#{m[1]}_spec.rb" }

      watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m|
          ["spec/routing/#{m[1]}_routing_spec.rb",
          "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb",
          "spec/acceptance/#{m[1]}_spec.rb",
          (m[1][/_pages/] ? "spec/requests/#{m[1]}_spec.rb" :
          "spec/requests/#{m[1].singularize}_pages_spec.rb")]
        end
      watch(%r{^app/views/(.+)/}) do |m|
          (m[1][/_pages/] ? "spec/requests/#{m[1]}_spec.rb" :
          "spec/requests/#{m[1].singularize}_pages_spec.rb")
        end
     end
spec_helper.rb:

require 'rubygems'
require 'spork'

Spork.prefork do
  # Loading more in this block will cause your tests to run faster. However,
  # if you change any configuration or code from libraries loaded here, you'll
  # need to restart spork for it take effect.
  # This file is copied to spec/ when you run 'rails generate rspec:install'
  ENV["RAILS_ENV"] ||= 'test'
  require File.expand_path("../../config/environment", __FILE__)
  require 'rspec/rails'
  require 'rspec/autorun'

  # Requires supporting ruby files with custom matchers and macros, etc,
  # in spec/support/ and its subdirectories.
  Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

  RSpec.configure do |config|
    # == Mock Framework
    #
    # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
    #
    # config.mock_with :mocha
    # config.mock_with :flexmock
    # config.mock_with :rr
    config.mock_with :rspec

    # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
    config.fixture_path = "#{::Rails.root}/spec/fixtures"

    # If you're not using ActiveRecord, or you'd prefer not to run each of your
    # examples within a transaction, remove the following line or assign false
    # instead of true.
    config.use_transactional_fixtures = true

    # If true, the base class of anonymous controllers will be inferred
    # automatically. This will be the default behavior in future versions of
    # rspec-rails.
    config.infer_base_class_for_anonymous_controllers = false
  end
end

Spork.each_run do
  # This code will be run each time you run your specs.

end

如果您在
spec/support
中更改了一个文件,您的规范会重新运行吗?我没有这样的文件。。。我应该吗?不,没必要。控制器呢?任何文件更改是否会导致guard更新?否。无更新。。。谢谢你的帮助!可能的副本。