I'm newbie in Rails. I did something and this warning appear:
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.3-compliant syntax, but you are running 2.2.1.
warning:please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Can anyone help me explain why it appear and how to fix it? Thanks a lot!
I got this error because I had the rubocop gem in my project which requires parser. I fixed it by locking my parser gem to the current ruby version we use.
For us, we use ruby 2.2.2, so I added gem 'parser', '~> 2.2.2.5'
to my test group.
Since rubocop 0.24, he has used parser v2.2.x which means we we need to use ruby >= 2.2.2 to avoid that warning. Though the gem only requires ruby 1.9.3, so you can still use it but you're going to get warnings.
I was seeing this not only for rubocop but also for rspec and so. Fixed it by updating the parser gem with bundler. Didn't really specify a gem version. Just the latest one.
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