Guard Rspec:不推荐使用cli选项,更改为:cmd选项

在我的rails应用程序中使用Guardfile

guard 'rspec', all_after_pass: false, cli: '--drb' do

不工作Guardfile

guard 'rspec', all_after_pass: false, cmd: '--drb' do

我已经多次打开了bundle exec guard ,但我发现即使我收到此消息Guard::RSpec DEPRECATION WARNING: The :cli option is deprecated. Please customize the new :cmd option to fit your need. Guard::RSpec DEPRECATION WARNING: The :cli option is deprecated. Please customize the new :cmd option to fit your need. 我做了适当的改动:cli是唯一一个使用rspec的人。

终端输出:cli

 01:49:14 - WARN - Guard::RSpec DEPRECATION WARNING: The :cli option is deprecated. Please customize the new :cmd option to fit your need. 01:49:15 - INFO - Guard is using Growl to send notifications. 01:49:15 - INFO - Guard is using Emacs to send notifications. 01:49:15 - INFO - Guard is using TerminalTitle to send notifications. 01:49:15 - INFO - Starting Spork for RSpec Using RSpec, Rails Preloading Rails environment Loading Spork.prefork block... Spork is ready and listening on 8989! 01:49:17 - INFO - Spork server for RSpec successfully started 01:49:17 - INFO - Guard::RSpec is running 01:49:17 - INFO - Guard is now watching at '/Users/me/rails_projects/mvp' [1] guard(main)> 01:49:18 - INFO - Run all 01:49:18 - INFO - Running all specs Running tests with args ["--color", "--failure-exit-code", "2", "--format", "progress", "--format", "Guard::RSpec::Formatter", "--require", "/Users/me/.rvm/gems/ruby-2.1.0@rails40/gems/guard-rspec-4.2.4/lib/guard/rspec/formatter.rb", "spec"]... ...................................................................... Finished in 0.76464 seconds 70 examples, 0 failures Randomized with seed 47137 Done. 

终端输出:cmd

 bundle exec guard 01:58:55 - INFO - Guard is using Growl to send notifications. 01:58:55 - INFO - Guard is using Emacs to send notifications. 01:58:55 - INFO - Guard is using TerminalTitle to send notifications. 01:58:55 - INFO - Starting Spork for RSpec Using RSpec, Rails Preloading Rails environment Loading Spork.prefork block... Spork is ready and listening on 8989! 01:58:57 - INFO - Spork server for RSpec successfully started 01:58:57 - INFO - Guard::RSpec is running 01:58:57 - INFO - Guard is now watching at '/Users/me/rails_projects/mvp' [1] guard(main)> 01:58:59 - INFO - Run all 01:58:59 - INFO - Running all specs [2] guard(main)> 

离开:cli还是有解决方案?

:cmd需要执行自定义的内容以满足我的需求。 正如@sevenseacat所说,“你没有自定义它以满足你的需求 – 你只是将cli复制到cmd并期望它能够工作”

我正在运行Spork,Guard和Rspec进行测试。 而不是只写–drb我应该在它前面添加rspec

固定Guardfile有

guard 'rspec', all_after_pass: false, cmd: 'rspec --drb' do