Quantcast
Channel: Vimタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 5608

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

$
0
0

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


Viewing all articles
Browse latest Browse all 5608

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>