7
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

Organization

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

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

キレイになりました!

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
7
Help us understand the problem. What are the problem?