How to enable Rubocop with Syntastic Vim and Rbenv plugin?

I would like to enable validation using Rubocop using Syntastic. I found that he has a checker and the path to the executable file is given. Although :SyntasticInforeports that this is not an active check. Also :SyntasticCheck rubocopreports that rubocop is not an available check.

Are there any other settings I need? Could this be caused by the warning messages indicated rubocop --version?


.vimrc settings

let g:syntastic_ruby_checkers          = ['rubocop', 'mri']
let g:syntastic_ruby_rubocop_exec      = '/Users/jjasonclark/.rbenv/shims/rubocop'

warning messages rubocop

warning: parser/current is loading parser/ruby21, which recognizes
warning: 2.1.5-compliant syntax, but you are running 2.1.2.
0.26.0

: . RBENV , Ruby. , Syntastic. , - Rubocop .

let g:syntastic_ruby_rubocop_exec = 'RBENV_VERSION=2.1.2 /Users/jjasonclark/.rbenv/shims/rubocop'

: Ruby 2.1.5 RBENV_VERSION, . Rubocop Syntastic. :SyntasticCheck rubocop syntastic: warning: checker rubocop is not available

+4
1

Syntastic Ruby. ruby -v && which ruby.

:

let g:syntastic_ruby_rubocop_exec      = '/Users/jjasonclark/.rbenv/shims/ruby /Users/jjasonclark/yourprojectname/bin/rubocop'

which ruby which rubocop .

+1

All Articles