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

[Fix #10893] Fix an error when running rubocop without bundle exec #10894

Merged
merged 1 commit into from Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/fix_an_error_for_no_bundle_exec.md
@@ -0,0 +1 @@
* [#10893](https://github.com/rubocop/rubocop/issues/10893): Fix an error when running `rubocop` without `bundle exec`. ([@koic][])
4 changes: 3 additions & 1 deletion lib/rubocop/feature_loader.rb
Expand Up @@ -30,7 +30,9 @@ def initialize(config_directory_path:, feature:)
end

def load
::Kernel.require(target)
# Don't use `::Kernel.require(target)` to prevent the following error:
# https://github.com/rubocop/rubocop/issues/10893
require(target)
rescue ::LoadError => e
raise if e.path != target

Expand Down