From 1c7a1269ca970928ee2341f5c57656be83f0a5ff Mon Sep 17 00:00:00 2001 From: Benjamin FAURE Date: Wed, 14 Jun 2023 10:13:15 +0200 Subject: [PATCH 1/2] Solved issue where spring was loaded in production mode --- bin/rspec | 1 - bin/spring | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/rspec b/bin/rspec index 01397d929f..6021396d7c 100755 --- a/bin/rspec +++ b/bin/rspec @@ -5,7 +5,6 @@ begin rescue LoadError => e raise unless e.message.include?('spring') end - # # This file was generated by Bundler. # diff --git a/bin/spring b/bin/spring index d89ee495fa..4080d890e1 100755 --- a/bin/spring +++ b/bin/spring @@ -1,15 +1,12 @@ #!/usr/bin/env ruby -# This file loads Spring without using Bundler, in order to be fast. +# This file loads Spring without using loading other gems in the Gemfile, in order to be fast. # It gets overwritten when you run the `spring binstub` command. -unless defined?(Spring) - require 'rubygems' +if !defined?(Spring) && [nil, 'development', 'test'].include?(ENV['RAILS_ENV']) require 'bundler' - lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) - spring = lockfile.specs.detect { |spec| spec.name == 'spring' } - if spring + Bundler.locked_gems.specs.find { |spec| spec.name == 'spring' }&.tap do |spring| Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path gem 'spring', spring.version require 'spring/binstub' From df693dc717cb1a08552468782f84d33870c1e7db Mon Sep 17 00:00:00 2001 From: Benjamin FAURE Date: Wed, 14 Jun 2023 10:15:34 +0200 Subject: [PATCH 2/2] Updated CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b28bcbab00..f08cac3fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## V4.2.0 +- Solved issue where spring was loaded in production mode : ran `bin/spring binstub --all` ## v4.1.0 **Note this upgrade is a migration from Ruby v2.7.6 to v3.0.5.** Note that this could have an impact on any customizations you may have made to your fork of this project. Please see https://www.fastruby.io/blog/ruby/upgrades/upgrade-ruby-from-2.7-to-3.0.html for further information on what to check. In particular, please note the changes to the way [Ruby 3 handles keyword arguments](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/)