Describe the Bug
Summary
After RuboCop is run in Cursor’s environment (e.g. pre-commit or from Cursor’s terminal), RuboCop’s user-level cache (~/.cache/rubocop_cache) stores the path to the inherited gem as a path under cursor-sandbox-cache. Later, RuboCop uses that cached path even when run from Terminal.app (not launched from Cursor), where the sandbox path does not exist, so it fails with “Configuration file not found” for that path. Clearing the RuboCop cache fixes the problem.
Observed Behavior
RuboCop’s user cache ends up containing (or being keyed by) the sandbox path for the gem used in inherit_gem.
Any later RuboCop run (including in Terminal.app) uses that path and fails with “Configuration file not found” for the sandbox path.
Workaround
Clear RuboCop’s user cache, then run RuboCop (or commit) again from Terminal.app:
rm -rf ~/.cache/rubocop_cachecd /path/to/projectbin/rubocop # or: git commit …
After that, RuboCop and pre-commit succeed in Terminal.app.
Technical notes
Project .bundle/config has BUNDLE_PATH: “vendor/bundle”; no global ~/.bundle/config; no BUNDLE_PATH/GEM_PATH/cursor/sandbox in .zshrc or .zprofile.
In Terminal.app, ruby -e “puts ENV[‘BUNDLE_PATH’]” and GEM_PATH are empty; resolving the gem via Bundler returns the correct vendor/bundle path. So the wrong path comes from RuboCop’s use of its cache, not from the current Bundler or Ruby env.
Steps to Reproduce
Open the project in Cursor and run something that runs RuboCop (e.g. git commit so lefthook runs RuboCop, or run bin/rubocop from Cursor’s terminal).
Open Terminal.app on its own (not from Cursor), cd to the project, and run bin/rubocop on any path (or run git commit so pre-commit runs RuboCop).
Observe: RuboCop fails with something like:
Configuration file not found: /private/var/folders/…/T/cursor-sandbox-cache/…/bundle/ruby/3.4.0/gems/-/lib/rubocop/default.yml
even though the file exists at the project’s bundle path (e.g. …/vendor/bundle/ruby/3.4.0/gems/-/lib/rubocop/default.yml).
In Terminal.app, bundle show and a small Ruby script using Bundler to resolve the gem both return the correct vendor/bundle path. No BUNDLE_PATH/GEM_PATH or sandbox paths appear in Gem.path or in the shell.
Expected Behavior
Cursor’s sandbox paths are not written into user-level caches used by tools (e.g. RuboCop’s cache), so the same tools keep working in a normal terminal.
Or RuboCop, when run under Cursor, does not cache absolute paths that refer to Cursor’s sandbox.
Operating System
MacOS
Version Information
Environment
macOS (arm64)
Cursor (version: 2.5.26)
Ruby 3.4.8 (mise)
Project: Rails app using Bundler with vendor/bundle, lefthook pre-commit, RuboCop inheriting from app-config gem (inherit_gem: -config: - lib/rubocop/default.yml)
Does this stop you from using Cursor
No - Cursor works, but with this issue