LoginSignup
8
1

More than 3 years have passed since last update.

【エラー解消】rubocop returns empty output! please check configuration

Last updated at Posted at 2021-03-30

いつからか VScode で ruby-rubocop を使っているときに rubocop が動かなくなっていた。

command /Users/X/.rbenv/shims/rubocop returns empty output! please check configuration という Warning が出ていて、ぐぐると which rubocop した結果を Execute パスに貼ったら動いたという記事をよく見かけるが、自分の場合は直らなかった。

empty output ということなので実際にどのような値が帰っているのか sh /Users/X/.rbenv/shims/rubocop をしてみたら cannot load such file -- rubocop-rails というエラーが出ていた。確かに PC を変えてから gem のインストールはしていなかったのでこれが原因だと分かったのであった。

gem install rubocop-rails をして解決

対象の .rubocop.yml ファイルは以下のようになっているはず。

require:
  - rubocop-rails
  - rubocop-rspec
  - rubocop-performance

この場合は、後 rubocop-rspec と rubocop-performance もインストールする必要がある

8
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
1