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

Rubocop not called from bundle exec #1674

Closed
1 task done
Signum opened this issue Jan 22, 2024 · 3 comments
Closed
1 task done

Rubocop not called from bundle exec #1674

Signum opened this issue Jan 22, 2024 · 3 comments
Labels
bug Something isn't working transferred This issue was transferred from vscode-ruby-lsp

Comments

@Signum
Copy link

Signum commented Jan 22, 2024

Operating System

Linux Mint 21.3

Ruby version

3.2.1

Project has a bundle

  • Has bundle

Ruby version manager being used

rbenv

Description

The extension and rubocop work well. However Rubocop complains about:

require 'net/ssh'

…with…

Required path net/ssh could not be resolved.RequireNotFound

…although I have this in my Gemfile…

gem "net-ssh", "~> 7.2"

…and my Ruby script can successfully use Net::SSH when started with "bundle exec".

When I run…

bundle exec rubocop my-script.rb

…it happily says…

1 file inspected, no offenses detected

I suspect that Rubocop may not be called as "bundle exec rubocop" and thus does not pick up the gems from my Gemfile.

@Signum Signum added the bug Something isn't working label Jan 22, 2024
@Signum
Copy link
Author

Signum commented Jan 22, 2024

I just noticed that this does not happen for another gem "ipaddr" I have added through Bundler.

image

I wonder if there is something specific with net-ssh.

@Earlopain
Copy link
Contributor

Are you sure your are actually using ruby-lsp? This error message appears to come from solargraph instead: https://github.com/castwide/solargraph/blob/d7a14bf3fefd3c82d77e1121c681cd4fb082e968/lib/solargraph/diagnostics/require_not_found.rb#L43-L51, they have an open PR for this castwide/solargraph#697

Perhaps you got both extensions activated.

@Signum
Copy link
Author

Signum commented Jan 22, 2024

@Earlopain You are right. I deactivated the VScode Solargraph Extension and the warning went away. Sorry for the confusion.

@Signum Signum closed this as completed Jan 22, 2024
@st0012 st0012 transferred this issue from Shopify/vscode-ruby-lsp Mar 18, 2024
@st0012 st0012 added the transferred This issue was transferred from vscode-ruby-lsp label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working transferred This issue was transferred from vscode-ruby-lsp
Projects
None yet
Development

No branches or pull requests

3 participants