LoginSignup
3
3

More than 5 years have passed since last update.

syntastic: error: checker ruby/rubocop: can't parse version string

Last updated at Posted at 2015-11-11

When check ruby syntax, some errors shown on console.

Screen Shot 2015-11-11 at 5.58.56 PM.png

"~/one/test.rb" 3L, 36C written
syntastic: error: checker output:
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.3-compliant syntax, but you are running 2.2.0.
0.34.2
syntastic: error: checker ruby/rubocop: can't parse version string (abnormal termination?)

Reason

There is some warnings when get rubocop's version:
Screen Shot 2015-11-11 at 6.09.34 PM.png

17:50:13-liubin~/one\ -> rubocop --version
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.3-compliant syntax, but you are running 2.2.0.
0.34.2
17:53:41-liubin~/one\ -> rubocop --version 2>/dev/null
0.34.2

Workaround

Disable warning when get rubocop's version:

Screen Shot 2015-11-11 at 6.00.04 PM.png

# ~/.vim/bundle/syntastic/plugin/syntastic/checker.vim
-        let command = a:0 ? a:1 : self.getExecEscaped() . ' --version'
+        let command = a:0 ? a:1 : self.getExecEscaped() . ' --version 2> /dev/null'

Reference

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