spring icon indicating copy to clipboard operation
spring copied to clipboard

`rails` command is not using spring, even when instrumented (`rake` does)

Open christiannelson opened this issue 7 years ago • 1 comments

Possibly related to https://github.com/rails/spring/issues/544.

The rake command is leveraging spring, but the rails command does not.

2.5.0:rails-5.2 % spring stop
Spring stopped.

2.5.0:rails-5.2 % ./bin/rails routes
Prefix Verb URI Pattern Controller#Action
  root GET  /           pages#root

2.5.0:rails-5.2 % ./bin/rake routes
Running via Spring preloader in process 42529
Prefix Verb URI Pattern Controller#Action
  root GET  /           pages#root

2.5.0:rails-5.2 % ./bin/rails routes
Prefix Verb URI Pattern Controller#Action
  root GET  /           pages#root

Checking out bin/rails shows that it's instrumented for spring...

#!/usr/bin/env ruby
begin
  load File.expand_path('../spring', __FILE__)
rescue LoadError => e
  raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'

But for some reason, spring isn't triggered.

christiannelson avatar Feb 01 '18 17:02 christiannelson

I think this is a duplicate of #485. This apparently has been a problem ever since Rails 5.0 was introduced. 😞

mattbrictson avatar Feb 05 '18 19:02 mattbrictson