先看症状:
➜ xxx git:(master) ✗ rails g migration create_something ^C/Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client/run.rb:98:in `gets': Interrupt from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client/run.rb:98:in `verify_server_version' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client/run.rb:56:in `run' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client/run.rb:37:in `warm_run' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client/run.rb:26:in `call' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client/command.rb:7:in `call' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client/rails.rb:24:in `call' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client/command.rb:7:in `call' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/client.rb:28:in `run' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/bin/spring:49:in `<top (required)>' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/binstub.rb:11:in `load' from /Users/user/.rvm/gems/ruby-2.3.0/gems/spring-1.6.3/lib/spring/binstub.rb:11:in `<top (required)>' from /Users/user/Projects/project/bin/spring:13:in `require' from /Users/user/Projects/project/bin/spring:13:in `<top (required)>' from bin/rails:3:in `load' from bin/rails:3:in `<main>'
不管怎么换代理呀,改网络啊,总是出错。同样是另一个项目就是正常的,后来才发现不同之处是新项目自带了spring. 是用来加快速度的。
在stackoverflow 也看到了同样的问题,还有ruby-china。
解决方案么也简单:
- spring stop
- 干掉spring