From b5c91e47960105417163bb4d678ef0603981dfd0 Mon Sep 17 00:00:00 2001 From: "Daniel P. Clark" <6ftdan@gmail.com> Date: Sun, 4 Oct 2026 19:53:35 +0000 Subject: [PATCH] Allow rake 13 and set up the bundle before the specs load the gem The gem depended on `rake ~> 12.3`, which keeps it out of any application that has moved to rake 13 (Rails 6 and later), and locked this project's own bundle to rake 12.3.x. Nothing here needs rake 12: thermite asks for `rake >= 10`, and the whole suite passes with rake 13.4.2. The pinned rake also broke running mspec outside `bundle exec`: spec/init loaded faster_path, which pulls in rake through thermite, before Bundler had set up the bundle, so the newest installed rake got activated and Bundler then refused to continue with "You have already activated rake 13.0.1, but your Gemfile requires rake 12.3.3". Setting up the bundle first makes the rake in Gemfile.lock the one that is loaded, whichever version it is. Fixes #180 Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01CXvfgWzuq28ewqT3AyhX4Z --- faster_path.gemspec | 2 +- spec/init.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/faster_path.gemspec b/faster_path.gemspec index a66e525..9616f74 100644 --- a/faster_path.gemspec +++ b/faster_path.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ['>= 2.5', '< 3.0'] spec.add_dependency 'bundler', '>= 1.12' - spec.add_dependency 'rake', '~> 12.3' + spec.add_dependency 'rake', '>= 12.3' spec.add_dependency 'thermite', '0.13.0' spec.add_development_dependency 'read_source', '~> 0.2.6' spec.add_development_dependency 'minitest', '~> 5.11' diff --git a/spec/init.rb b/spec/init.rb index 2c90a17..b5cedfc 100644 --- a/spec/init.rb +++ b/spec/init.rb @@ -1,4 +1,8 @@ ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__)) +# Set up the bundle before loading faster_path, which needs rake (through +# thermite): otherwise the newest installed rake gets activated and conflicts +# with the one in Gemfile.lock when mspec is run outside `bundle exec`. +require 'bundler/setup' $LOAD_PATH.unshift File.expand_path('../lib', File.dirname(__FILE__)) require 'faster_path' require 'faster_path/optional/monkeypatches'