1

这似乎有点奇怪,但 gemspring-commands-rspec对我不起作用。有没有其他人遇到过这种宝石的这种奇怪行为?

我已经安装了两者spring (1.3.5)spring-commands-rspec (1.0.4) 而且似乎我遇到了为 rspec 运行 spring server 的麻烦。请查看日志

sergey@Pisuk:~/projects/fasteria$ time bin/rake db:migrate

real    0m2.013s
user    0m0.092s
sys 0m0.008s
sergey@Pisuk:~/projects/fasteria$ time bin/rake db:migrate

real    0m0.304s
user    0m0.087s
sys 0m0.008s

# it's worked

sergey@Pisuk:~/projects/fasteria$ time bin/rspec spec/models/user_spec.rb 
...

Finished in 1.1 seconds (files took 3 seconds to load)
3 examples, 0 failures

real    0m4.274s
user    0m0.087s
sys 0m0.008s
sergey@Pisuk:~/projects/fasteria$ time bin/rspec spec/models/user_spec.rb 
...

Finished in 1.12 seconds (files took 2.98 seconds to load)
3 examples, 0 failures

real    0m4.261s
user    0m0.088s
sys 0m0.008s
# doesn't work

这是我的 Gemfile:

group :development do
  ...
  gem 'spring-commands-rspec'
  gem 'spring'
end

我使用rvm -v 1.26.11, ruby -v 2.2.1p85, rails -v 4.2.0, ubuntu 14.04。

这是sprng status命令的输出:

Spring is running:

20677 spring server | fasteria | started 7 mins ago
20685 spring app    | fasteria | started 7 mins ago | development mode                                             
21872 spring app    | fasteria | started 6 mins ago | test mode 

怎么了?PS我跑spring stop了很多次

更新添加弹簧日志

常用 rake 命令日志

[2015-05-06 11:00:02 +0300] [22694] [server] accepted client
[2015-05-06 11:00:02 +0300] [22694] [server] running command rake
[2015-05-06 11:00:02 +0300] [22965] [client] sending command
[2015-05-06 11:00:02 +0300] [22697] [application:development] got client
[2015-05-06 11:00:02 +0300] [22697] [application:development] forked 22967
[2015-05-06 11:00:02 +0300] [22694] [application_manager:development] got worker pid 22967
[2015-05-06 11:00:02 +0300] [22965] [client] got pid: 22967
[2015-05-06 11:00:02 +0300] [22697] [application:development] 22967 exited with 0
[2015-05-06 11:00:02 +0300] [22965] [client] got exit status 0

Rspec 日志

[2015-05-06 10:57:56 +0300] [22694] [server] accepted client
[2015-05-06 10:57:56 +0300] [22694] [server] running command rspec
[2015-05-06 10:57:56 +0300] [22814] [client] sending command
[2015-05-06 10:57:56 +0300] [22756] [application:test] got client
[2015-05-06 10:57:56 +0300] [22756] [application:test] forked 22816
[2015-05-06 10:57:56 +0300] [22694] [application_manager:test] got worker pid 22816
[2015-05-06 10:57:56 +0300] [22814] [client] got pid: 22816
[2015-05-06 10:57:56 +0300] [22694] [server] accepted client
[2015-05-06 10:57:56 +0300] [22694] [server] running command rake
[2015-05-06 10:57:56 +0300] [22821] [client] sending command
[2015-05-06 10:57:56 +0300] [22756] [application:test] got client
[2015-05-06 10:57:56 +0300] [22756] [application:test] forked 22823
[2015-05-06 10:57:56 +0300] [22694] [application_manager:test] got worker pid 22823
[2015-05-06 10:57:56 +0300] [22821] [client] got pid: 22823
[2015-05-06 10:57:58 +0300] [22756] [application:test] 22823 exited with 0
[2015-05-06 10:57:58 +0300] [22821] [client] got exit status 0
[2015-05-06 10:58:00 +0300] [22756] [application:test] 22816 exited with 0
[2015-05-06 10:58:00 +0300] [22814] [client] got exit status 0
4

0 回答 0