"bundle exec rake test" 待定

"bundle exec rake test" is pending

当我 运行 bundle exec rake test 在我的申请下,它永远处于待定状态。然后我输入 Ctrl-c 来阻止它。然后它给出这些信息:

^C/home/ishamo/.rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client/run.rb:54:in `gets': Interrupt
    from /home/ishamo/.rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client/run.rb:54:in `verify_server_version'
    from /home/ishamo/.rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client/run.rb:25:in `call'
    from /home/ishamo/.rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
    from /home/ishamo/.rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
    from /home/ishamo/.rvm/gems/ruby-2.2.1/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
    from /home/ishamo/.rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
    from /home/ishamo/.rvm/gems/ruby-2.2.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
    from /home/ishamo/ra/sample_app/bin/spring:13:in `require'
    from /home/ishamo/ra/sample_app/bin/spring:13:in `<top (required)>'
    from bin/rake:3:in `load'
    from bin/rake:3:in `<main>'
rake aborted!
Interrupt: 
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:401:in `system'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:401:in `block in load_schema_if_pending!'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:398:in `load_schema_if_pending!'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:411:in `block in maintain_test_schema!'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:642:in `suppress_messages'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:416:in `method_missing'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.5/lib/active_record/migration.rb:411:in `maintain_test_schema!'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_help.rb:19:in `<top (required)>'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
/home/ishamo/ra/sample_app/test/test_helper.rb:3:in `<top (required)>'
/home/ishamo/ra/sample_app/test/controllers/static_pages_controller_test.rb:1:in `require'
/home/ishamo/ra/sample_app/test/controllers/static_pages_controller_test.rb:1:in `<top (required)>'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_unit/sub_test_task.rb:114:in `require'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_unit/sub_test_task.rb:114:in `block (3 levels) in define'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_unit/sub_test_task.rb:114:in `each'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_unit/sub_test_task.rb:114:in `block (2 levels) in define'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_unit/sub_test_task.rb:113:in `each'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_unit/sub_test_task.rb:113:in `block in define'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_unit/sub_test_task.rb:20:in `invoke_rake_task'
/home/ishamo/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/test_unit/testing.rake:8:in `block in <top (required)>'
/home/ishamo/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
/home/ishamo/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => test:run
(See full trace by running task with --trace)

我是初学者。你能告诉我怎么做吗?欣赏。

我自己有时也注意到这个问题,控制台挂起是因为 Rails Spring 中的一个问题。 Spring 是一个 Rails 应用程序预加载器,旨在更快地开发和测试 Rails 应用程序。

尝试 运行:

spring stop

或:

bin/spring stop

..然后重试。

如果这没有帮助,请注释掉 Rakefile 中的行:

# Spring speeds up development by keeping your application running 
# in the background. Read more: https://github.com/rails/spring
gem 'spring'

这将完全禁用 Spring。 Rails 启动会慢一点(没有内存预加载),但你会避免挂起问题。

此问题之前似乎已在 GitHub 此处讨论过:
https://github.com/rails/spring/issues/265