Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: cannot load such file -- lint_roller/context when trying to audit a formula #19360

Closed
3 tasks done
botantony opened this issue Feb 24, 2025 · 2 comments
Closed
3 tasks done
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this

Comments

@botantony
Copy link
Contributor

botantony commented Feb 24, 2025

brew doctor output

Your system is ready to brew.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.4.21-103-g89d1d6b
ORIGIN: https://github.com/Homebrew/brew
HEAD: 89d1d6b8f4adb0b8f6678912f648dca2475b7c7c
Last commit: 4 hours ago
Branch: master
Core tap HEAD: d62a741a434aff3f62e50b58b578f980dc6d3797
Core tap last commit: 8 minutes ago
Core tap JSON: 24 Feb 12:54 UTC
Core cask tap HEAD: ec41f2fa77f9975013c14e440d69684b93fcb76b
Core cask tap last commit: 4 minutes ago
Core cask tap JSON: 24 Feb 12:54 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.EIa1FmaS3g/org.xquartz:0
HOMEBREW_EDITOR: nvim
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 16.0.0 build 1600
Git: 2.48.1 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.3-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: 16.2
Rosetta 2: false

What were you trying to do (and why)?

I was trying to run brew audit [some random formula] and got Error: cannot load such file -- lint_roller/context message.

What happened (include all command output)?

$ brew audit curl
Error: cannot load such file -- lint_roller/context
Warning: Removed Sorbet lines from backtrace!
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/plugin/configuration_integrator.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/plugin.rb:3:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/plugin.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/config_loader_resolver.rb:5:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/config_loader_resolver.rb:5:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop.rb:765:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop.rb:765:in `<top (required)>'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/homebrew/Library/Homebrew/style.rb:119:in `block in run_rubocop'
/opt/homebrew/Library/Homebrew/warnings.rb:29:in `ignore'
/opt/homebrew/Library/Homebrew/style.rb:118:in `run_rubocop'
/opt/homebrew/Library/Homebrew/style.rb:74:in `check_style_impl'
/opt/homebrew/Library/Homebrew/style.rb:36:in `check_style_json'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:195:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:95:in `<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

The same happens with all other formulae and casks. Adding/removing flags doesn't help, f.e.:

$ brew audit --strict rust
Warning: Cask rust was renamed to homebrew/core/rust.
Error: cannot load such file -- lint_roller/context
Warning: Removed Sorbet lines from backtrace!
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/plugin/configuration_integrator.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/plugin.rb:3:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/plugin.rb:3:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/config_loader_resolver.rb:5:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop/config_loader_resolver.rb:5:in `<top (required)>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop.rb:765:in `require_relative'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.72.2/lib/rubocop.rb:765:in `<top (required)>'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/homebrew/Library/Homebrew/style.rb:119:in `block in run_rubocop'
/opt/homebrew/Library/Homebrew/warnings.rb:29:in `ignore'
/opt/homebrew/Library/Homebrew/style.rb:118:in `run_rubocop'
/opt/homebrew/Library/Homebrew/style.rb:74:in `check_style_impl'
/opt/homebrew/Library/Homebrew/style.rb:36:in `check_style_json'
/opt/homebrew/Library/Homebrew/dev-cmd/audit.rb:195:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:95:in `<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

What did you expect to happen?

I expected this command to work as usual (i.e. either exit with 0 or print what is wrong with a formula)

Step-by-step reproduction instructions (by running brew commands)

$ brew audit curl
# Not sure if it can be reproduced or just an issue on my device
# Maybe there is a solution to this problem but I couldn't find anything neither on github issues nor the internet
@botantony botantony added the bug Reproducible Homebrew/brew bug label Feb 24, 2025
@MikeMcQuaid
Copy link
Member

Not sure if it can be reproduced or just an issue on my device

I can't reproduce this but: we should still have better handling of cases like this as it's pretty hard to debug otherwise. Thanks for the report!

@MikeMcQuaid MikeMcQuaid added the help wanted We want help addressing this label Feb 24, 2025
@botantony
Copy link
Contributor Author

For some reason vendored gem lint_roller didn't have context.rb file:

$ brew ruby -e 'require "lint_roller/context"; puts "no errors"'

<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- lint_roller/context (LoadError)
        from <internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from -e:1:in `<main>'

brew vendor-gems fixed the issue:

$ brew ruby -e 'require "lint_roller/context"; puts "no errors"'

no errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this
Projects
None yet
Development

No branches or pull requests

2 participants