1
我無法在網上找到答案。這是試圖運行bundle exec guard
未初始化的常量Guard :: Dsl :: Minitest
00:53:52 - ERROR - Invalid Guardfile, original error is:
> [#]
> [#] uninitialized constant Guard::Dsl::Minitest,
> [#] backtrace:
> [#] (dsl)> ./Guardfile:27:in `block in evaluate'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/dsl.rb:178:in `guard'
> [#] (dsl)> ./Guardfile:26:in `evaluate'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/dsl.rb:377:in `instance_eval'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/dsl.rb:377:in `evaluate'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/guardfile/evaluator.rb:91:in `evaluate'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard.rb:134:in `_evaluate'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard.rb:49:in `setup'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/commander.rb:32:in `start'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/cli/environments/valid.rb:16:in `start_guard'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/cli.rb:113:in `start'
> [#] (dsl)> /home/user/.rvm/rubygems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#] (dsl)> /home/user/.rvm/rubygems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#] (dsl)> /home/user/.rvm/rubygems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#] (dsl)> /home/user/.rvm/rubygems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/aruba_adapter.rb:32:in `execute'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#] (dsl)> /home/user/.rvm/rubygems/guard-2.12.5/bin/_guard-core:11:in `<main>'
這是Guardfile
guard :minitest do
with Minitest::Unit
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r{^test/test_helper\.rb$}) { 'test' }
#with Minitest::Spec
# watch(%r{^spec/(.*)_spec\.rb$})
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
# Rails 4
watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
watch(%r{^app/bridges/(.+)_bridge\.rb$}) { |m| "test/bridges/#{m[1]}_test.rb" }
watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
watch(%r{^test/.+_test\.rb$})
watch(%r{^test/test_helper\.rb$}) { 'test' }
# Rails < 4
# watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
# watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
# watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
end
在我的Gemfile我在test
和development
組都gem 'guard'
和gem 'guard-minitest'
時,我發現了錯誤。
我在minitest,guard或guard-minitest github中沒有看到這方面的任何文檔。爲什麼期望Guard :: Dsl :: Minitest,爲什麼我不能在guard-minitest的源代碼中找到它?
- 的Rails 4.1.10
- 的Ruby 2.2.1
- 後衛2.12.5
- 護COMPAT 1.2.1
- 護MINITEST 2.4.4
這是我第一次嘗試使用警衛的經歷。幫助表示讚賞。
只是一種預感,但與MINITEST ::在Guardfile單位發表意見 – dbkbali 2015-04-02 06:38:45