From 2bb8d154038ef1b992e56036b3d7308b6dea09af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20V=C3=A1squez?= Date: Fri, 10 Jul 2026 00:06:39 -0600 Subject: [PATCH] Remove spring and spring-watcher-listen (dev preloader) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit spring is optional developer tooling (an app preloader), not required at Rails 8.1 — modern Rails no longer ships it in the default Gemfile. It's a direct-only dependency here (nothing pulls it transitively), and in practice it's been a source of stale-state/hang gotchas (commands had to be run with DISABLE_SPRING=1). Dropping it simplifies the dev setup with no runtime impact. - Gemfile: remove gem "spring" + gem "spring-watcher-listen" (and the pin comment) - bin/rails, bin/rake: drop the spring loader preamble (standard binstubs) - delete bin/spring and config/spring.rb - both lockfiles updated Verified locally: bin/rails runner + bin/rake work without the preamble, test suite 16/52/0 (run via the binstubs), rubocop + reek clean. --- Gemfile | 4 ---- Gemfile.lock | 6 ------ Gemfile.next.lock | 6 ------ bin/rails | 5 ----- bin/rake | 5 ----- bin/spring | 17 ----------------- config/spring.rb | 12 ------------ 7 files changed, 55 deletions(-) delete mode 100755 bin/spring delete mode 100644 config/spring.rb diff --git a/Gemfile b/Gemfile index 7929ac8..3b117bb 100644 --- a/Gemfile +++ b/Gemfile @@ -69,10 +69,6 @@ group :development do gem "web-console", ">= 3.3.0" gem "listen", ">= 3.5" gem "reek" - # spring 4.x / spring-watcher-listen 2.1.x need Ruby >= 3.1, which we now - # satisfy -- previously dropped during the Rails 6.1 -> 7.0 hop. - gem "spring" - gem "spring-watcher-listen", "~> 2.1.0" end # Exception tracking. Reports unhandled exceptions to Sentry in production; diff --git a/Gemfile.lock b/Gemfile.lock index 25fe8ae..920bfb8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -373,10 +373,6 @@ GEM bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) logger - spring (4.7.0) - spring-watcher-listen (2.1.0) - listen (>= 2.7, < 4.0) - spring (>= 4) sprockets (4.2.2) concurrent-ruby (~> 1.0) logger @@ -444,8 +440,6 @@ DEPENDENCIES selenium-webdriver sentry-rails sentry-ruby - spring - spring-watcher-listen (~> 2.1.0) terser tzinfo-data web-console (>= 3.3.0) diff --git a/Gemfile.next.lock b/Gemfile.next.lock index 25fe8ae..920bfb8 100644 --- a/Gemfile.next.lock +++ b/Gemfile.next.lock @@ -373,10 +373,6 @@ GEM bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) logger - spring (4.7.0) - spring-watcher-listen (2.1.0) - listen (>= 2.7, < 4.0) - spring (>= 4) sprockets (4.2.2) concurrent-ruby (~> 1.0) logger @@ -444,8 +440,6 @@ DEPENDENCIES selenium-webdriver sentry-rails sentry-ruby - spring - spring-watcher-listen (~> 2.1.0) terser tzinfo-data web-console (>= 3.3.0) diff --git a/bin/rails b/bin/rails index 5badb2f..0739660 100755 --- a/bin/rails +++ b/bin/rails @@ -1,9 +1,4 @@ #!/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' diff --git a/bin/rake b/bin/rake index d87d5f5..1724048 100755 --- a/bin/rake +++ b/bin/rake @@ -1,9 +1,4 @@ #!/usr/bin/env ruby -begin - load File.expand_path('../spring', __FILE__) -rescue LoadError => e - raise unless e.message.include?('spring') -end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/spring b/bin/spring deleted file mode 100755 index fb2ec2e..0000000 --- a/bin/spring +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby - -# This file loads spring without using Bundler, in order to be fast. -# It gets overwritten when you run the `spring binstub` command. - -unless defined?(Spring) - require 'rubygems' - require 'bundler' - - lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) - spring = lockfile.specs.detect { |spec| spec.name == "spring" } - if spring - Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path - gem 'spring', spring.version - require 'spring/binstub' - end -end diff --git a/config/spring.rb b/config/spring.rb deleted file mode 100644 index 8b60e47..0000000 --- a/config/spring.rb +++ /dev/null @@ -1,12 +0,0 @@ -%w[ - .ruby-version - .rbenv-vars - tmp/restart.txt - tmp/caching-dev.txt -].each { |path| Spring.watch(path) } - -# Test env intentionally runs with config.enable_reloading = false for -# performance/correctness; Spring's reloader requirement doesn't apply -# there since a single spring-preloaded process doesn't need to reload -# code mid-suite. -Spring.dangerously_allow_disabling_reloading = true