spring
spring copied to clipboard
Rails 5 compatibility
One nice feature of rails 5 - "rails" utility can execute rake commands. So instead of "rake db:migrate" one can use "rails rb:migrate". But currently spring can't detect this case and those commands pass beside spring.
I'm using spring 1.7.2 and rails 5.0.0.rc2
This is still an issue with Spring 2.0.1 & Rails 5.0.1 which is pretty disappointing considering we're supposed to use rails instead of rake now.
$ bin/spring binstub rails # Just to be sure
* bin/rails: spring already present
$ bin/spring status
Spring is not running.
$ bin/rails routes
Prefix Verb URI Pattern Controller#Action
root GET / spots#index
$ bin/spring status
Spring is not running.
$ bin/rake routes
Running via Spring preloader in process 43483
Prefix Verb URI Pattern Controller#Action
root GET / spots#index
Yes, it would be great if somebody could work on a PR
It seems like the example presented by @swrobel still holds. I'm not sure if this was also the case back in February, but as of 5.1.2 bin/rails g does invoke the spring preloader.
I am currently on rails 5.1.4 and spring 2.0.2; doesn't seem to me that spring loads up. I think it's related to this issue because on other version of rails, spring seems to be fine. Here's my dump
^C~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client/run.rb:117:in `gets': Interrupt
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client/run.rb:117:in `verify_server_version'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client/run.rb:62:in `run'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client/run.rb:42:in `warm_run'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client/run.rb:35:in `call'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client/rails.rb:24:in `call'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
from ~/.rvm/gems/ruby-2.4.0@rails5/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
from ~/Projects/ruby/rails/bucketer/bin/spring:16:in `require'
from ~/Projects/ruby/rails/bucketer/bin/spring:16:in `<top (required)>'
from bin/rails:5:in `load'
from bin/rails:5:in `<main>'
I'm experiencing this as well. I'm on:
Rails 5.2.4.2
Spring version 2.1.0