我今天根据 Michael Hartl 的 Rails 教程 ( http://youtu.be/FZ-b9oZpCZY和http://ruby.railstutorial.org/chapters/static-pages#sec-advanced_setup中的高级设置设置了一个新的 Rails 应用程序)。我以前做过,但特别是 Guard 的输出非常不同。
首先,之前,Guard 会运行并坐在那里监听变化,而在新项目中,Guard 运行一个控制台。它仍然坐在那里并在发生更改时运行测试,但我想知道是否有人知道为什么会这样,特别是据我所知,我已经将这个项目设置为与我的其他项目完全相同(Gemfiles 完全相同)。
其次,所有输出消息都带有时间戳和前面的 INFO。再说一次,有谁知道这是为什么?
只是为了说明,这是一个旧项目的输出:
$ guard
Guard uses Growl to send notifications.
Guard is now watching at '/Users/billmurray/rails_projects/sample_app'
Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
Guard::RSpec is running, with RSpec 2!
Running all specs
Running tests with args ["--color", "--failure-exit-code", "2", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/billmurray/.rvm/gems/ruby-1.9.3-p194@rails3tutorial/gems/guard-rspec-1.2.1/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.........
Finished in 0.66338 seconds
9 examples, 0 failures
Randomized with seed 46867
Done.
新应用程序也是如此。请注意控制台如何在底部启动。
$ guard
14:52:42 - INFO - Guard uses Growl to send notifications.
14:52:42 - INFO - Guard uses TerminalTitle to send notifications.
14:52:42 - INFO - Guard is now watching at '/Users/billmurray/rails_projects/new_app'
14:52:42 - INFO - Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
14:52:47 - INFO - Spork server for RSpec successfully started
14:52:47 - INFO - Guard::RSpec is running, with RSpec 2!
14:52:47 - INFO - Running all specs
Running tests with args ["--color", "--failure-exit-code", "2", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/billmurray/.rvm/gems/ruby-1.9.3-p194@rails3tutorial/gems/guard-rspec-1.2.1/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
No examples found.
Finished in 0.00213 seconds
0 examples, 0 failures
Randomized with seed 11776
Done.
[1] guard(main)>
这并没有阻止事情运行,但我想知道是什么原因造成的。我可能应该提到我正在使用 Mac OS X Mountain Lion。任何帮助将不胜感激。谢谢!