Skip to content

Allow rake 13 and set up the bundle before the specs load the gem - #183

Merged
danielpclark merged 1 commit into
masterfrom
claude/determined-shannon-ybz9nf-rake-dependency
Oct 4, 2026
Merged

danielpclark merged 1 commit into
masterfrom
claude/determined-shannon-ybz9nf-rake-dependency

Conversation

@danielpclark

Copy link
Copy Markdown
Owner

Fixes #180.

What

  • faster_path.gemspec: the runtime dependency on rake becomes >= 12.3 instead of ~> 12.3.
  • spec/init.rb: require 'bundler/setup' right after BUNDLE_GEMFILE is set, before faster_path is loaded.

Why

rake ~> 12.3 keeps the gem out of any application that has moved on to rake 13 (Rails 6 and later lock rake 13), the same kind of problem the bundler ~> 1.12 pin caused in #174 / #178. Nothing here needs rake 12: thermite 0.13.0 asks for rake >= 10, and the whole suite passes with rake 13.4.2.

The pin was also the root cause of #180. spec/init.rb loaded faster_path, which pulls in rake through thermite, before Bundler had set up the bundle. So the newest rake installed on the machine was activated first, and Bundler then refused with "You have already activated rake 13.0.1, but your Gemfile requires rake 12.3.3". This reproduces today on a plain bundle install checkout with bundle exec rake test (Ruby 2.7.8 ships rake 13.0.1), and CI only avoided it because setup-ruby installs the bundle into a vendored path that hides the system rake. Loading the bundle first makes the rake in Gemfile.lock the one that is loaded, whichever version that is.

Verification

With Ruby 2.7.8 on Linux, TEST_MONKEYPATCHES=true WITH_REGRESSION=true ENCODING=true bundle exec rake test (cargo tests, minitest, rubocop, pbench, mspec) passes both with rake 12.3.3 and with rake 13.4.2 in Gemfile.lock. The exact command from the issue, ruby -r spec/init spec/mspec/bin/mspec-run --format spec core/file/basename ..., run without bundle exec, now passes too.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CXvfgWzuq28ewqT3AyhX4Z


Generated by Claude Code

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXvfgWzuq28ewqT3AyhX4Z
@semanticdiff-com

Copy link
Copy Markdown

Review changes with  SemanticDiff

@danielpclark danielpclark mentioned this pull request Oct 4, 2026
@danielpclark
danielpclark merged commit 2540e67 into master Oct 4, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rake test not working for Ruby 2.6.3 - Dependencies problem

1 participant