gpt4 book ai didi

ruby-on-rails - Guard Rspec :cli option is deprecated, 更改为 :cmd 选项

转载 作者:行者123 更新时间:2023-12-04 03:33:45 24 4
gpt4 key购买 nike

工作Guardfile在我的 Rails 应用中
guard 'rspec', all_after_pass: false, cli: '--drb' do
不工作 Guardfileguard '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.并且我进行了适当的更改,: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

关于ruby-on-rails - Guard Rspec :cli option is deprecated, 更改为 :cmd 选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21215357/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com