10
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rubocopしたらparserの設定でwarningでた。

Posted at

bundle updateしてrubocopかけたところ謎のwarningが・・・

現象

$ rubocop
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.3-compliant syntax, but you are running 2.2.2.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Inspecting 113 files
.................................................................................................................

113 files inspected, no offenses detected

成功はしたけど。。なんかでてる。。

調べた

とりあえず↑にでてた
https://github.com/whitequark/parser#compatibility-with-ruby-mri
を見てみるも何したらいいかよくわからない。。

issueがあった。
https://github.com/whitequark/parser/issues/189

parserのバージョンが合ってないことを雰囲気で感じ取ったので、バージョンを指定すれば良さそう。

Gemfile.lockを確認すると

Gemfile.lock
    parser (2.2.3.0)
      ast (>= 1.1, < 3.0)

2.2.2系に戻そう。

Gemfile設定

  gem 'parser', '~> 2.2.2.6'

parser更新(バージョン戻す)

$ bundle update parser
...
Using parser 2.2.2.6 (was 2.2.3.0)
...

確認

$ rubocop
Inspecting 113 files
.................................................................................................................

113 files inspected, no offenses detected

キレイになりました!

10
7
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
10
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?