Summary
The RUBY_EXEC_FOR,rspec macro in Makefile (v1.11.0, line 84) only matches projects that have a bare top-level rspec gem in Gemfile.lock. Rails projects that depend on rspec-rails (the idiomatic Rails-side dependency) only have rspec-core/rspec-expectations/rspec-mocks/rspec-rails in the lock — no bare rspec line — so the macro returns empty, the _test target invokes the bare `rspec` binary, and Bundler is bypassed.
Reproduction
- Standard Rails 7 project with `gem 'rspec-rails', '~> 6'` in the Gemfile.
- `make check` (test stage) inside the dev-toolchain v1.11.0 container.
- Bareword `rspec` activates the dev-toolchain's system gems before Bundler resolves, producing:
```
Gem::LoadError: You have already activated cgi 0.4.2, but your Gemfile requires cgi 0.5.1.
```
(Cgi specifically — any default-gem conflict between the toolchain's preinstalled gems and the project's Gemfile would surface the same way.)
Root cause
```make
RUBY_EXEC_FOR = $(if $(and $(wildcard Gemfile.lock),$(shell grep -m1 -E "^[[:space:]]+$(1)[[:space:]]" Gemfile.lock 2>/dev/null)),bundle exec ,)
```
The grep pattern `^[[:space:]]+rspec[[:space:]]` requires a literal `rspec` (no suffix). `rspec-rails` projects don't have one — `rspec-core` is the actual runner.
Suggested fix
Either:
- Broaden the macro to also accept `rspec-rails` / `rspec-core`: `grep -m1 -E "^[[:space:]]+(rspec|rspec-core|rspec-rails)[[:space:]]"`.
- Or: always `bundle exec` when a `Gemfile.lock` exists at all (simpler and safer — bareword rspec inside a Rails project is essentially never what the user wants).
Workaround
Run `bundle exec rspec` directly. Confirmed all 422 specs pass that way; the failure is purely the wrapper macro.
Context
Companion to #42 (BUNDLE_PATH override) and the now-closed #30. Same class of issue: `make check`'s ruby test stage is not consumable as-shipped by typical Rails projects.
Summary
The
RUBY_EXEC_FOR,rspecmacro inMakefile(v1.11.0, line 84) only matches projects that have a bare top-levelrspecgem inGemfile.lock. Rails projects that depend onrspec-rails(the idiomatic Rails-side dependency) only haverspec-core/rspec-expectations/rspec-mocks/rspec-railsin the lock — no barerspecline — so the macro returns empty, the_testtarget invokes the bare `rspec` binary, and Bundler is bypassed.Reproduction
```
Gem::LoadError: You have already activated cgi 0.4.2, but your Gemfile requires cgi 0.5.1.
```
(Cgi specifically — any default-gem conflict between the toolchain's preinstalled gems and the project's Gemfile would surface the same way.)
Root cause
```make$(if $ (and $(wildcard Gemfile.lock),$ (shell grep -m1 -E "^[[:space:]]+$(1)[[:space:]]" Gemfile.lock 2>/dev/null)),bundle exec ,)
RUBY_EXEC_FOR =
```
The grep pattern `^[[:space:]]+rspec[[:space:]]` requires a literal `rspec` (no suffix). `rspec-rails` projects don't have one — `rspec-core` is the actual runner.
Suggested fix
Either:
Workaround
Run `bundle exec rspec` directly. Confirmed all 422 specs pass that way; the failure is purely the wrapper macro.
Context
Companion to #42 (BUNDLE_PATH override) and the now-closed #30. Same class of issue: `make check`'s ruby test stage is not consumable as-shipped by typical Rails projects.