/Users/me/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in ``find_spec_for_exe': can't find gem rubocop (>= 0.a) with executable rubocop (Gem::GemNotFoundException) from /Users/me/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in ``activate_bin_path' from /Users/me/.rbenv/versions/2.5.1/bin/rubocop:23:in
'
This is the error I keep getting whenever I type something. Does anyone know how to fix this problem?
Go on VSCode Marketplace and clic on the Download Extension button. Install the extension manually from the CLI: code --install-extension misogi. ruby-rubocop-0.8.
VSCode supports multiple languages like C, C++, Python, Ruby, etc. it includes features like debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git.
RuboCop is a Ruby static code analyzer (a.k.a. linter ) and code formatter. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide. Apart from reporting the problems discovered in your code, RuboCop can also automatically fix many of them for you.
After many agonising hours and reading other solutions I finally deduce that the answer was in installing Rubocop from the root. Below steps worked when I tried. You first need to go the root in your terminal. Install Rubocop then find the path and add it to the execute path in Rubocop settings
$ cd ~
$ gem install rubocop
$ which rubocop
Paste location given in Ruby-Rubocop configuration settings > Execute Path
/Users/username/.rvm/gems/ruby-2.6.1/bin/
I can propose you 2 solutions because I had experienced the same problem:
For me installing the bundler
with sudo
-> sudo gem install bundler
fix the issue.
Also it can be a mistake coming from you RubyGems
version. It seems like ruby -v2.5
has a compatible problem with RubyGems -v2.7.3
. So try upgrading the RubyGems
to -v2.7.4
using the gem update --system
command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With