I keep getting 'unexpected token kEND (Using Ruby 2.1 parser; configure using `TargetRubyVersion` parameter, under `AllCops`

1,744 views
Skip to first unread message

bobothewise

unread,
Nov 27, 2017, 1:46:53 PM11/27/17
to vim-syntastic
My project is using ruby 2.3 and I have a .rubocop.yml with 2.3 as the target set.
For some reason, I keep getting this error when it comes to the new safe reference navigator syntax.
It seems like it's looking at some other yml file and doesn't see the one with the 2.3 target.
Any help is appreciated.

LCD 47

unread,
Nov 27, 2017, 1:56:31 PM11/27/17
to vim-syntastic

bobothewise

unread,
Nov 27, 2017, 2:08:38 PM11/27/17
to vim-syntastic
Hi thank you for responding so quickly. 
I'm using chruby and I have selected ruby 2.3.1
I have also installed rubocop under that ruby version.

$ which ruby => /Users/me/.rubies/ruby-2.3.1/bin/ruby

my ~/.vimrc has the following:

let g:syntastic_ruby_mri_exec = '/Users/me/.rubies/ruby-2.3.1/bin/ruby'
let g:syntastic_ruby_checkers = [ 'mri']

I run rubocop manually using :SyntasticCheck rubocop

LCD 47

unread,
Nov 27, 2017, 2:14:34 PM11/27/17
to vim-syntastic
On 27 November 2017, bobothewise <ojbu...@gmail.com> wrote:
> Hi thank you for responding so quickly.
> I'm using chruby and I have selected ruby 2.3.1
> I have also installed rubocop under that ruby version.
>
> $ which ruby => /Users/me/.rubies/ruby-2.3.1/bin/ruby
>
> my ~/.vimrc has the following:
>
> let g:syntastic_ruby_mri_exec = '/Users/me/.rubies/ruby-2.3.1/bin/ruby'
> let g:syntastic_ruby_checkers = [ 'mri']
>
> I run rubocop manually using :SyntasticCheck rubocop

This is not supported. The supported way is still the one described
in the FAQ:

> On Monday, November 27, 2017 at 10:56:31 AM UTC-8, LCD 47 wrote:
> > https://github.com/vim-syntastic/syntastic#faqruby

/lcd

bobothewise

unread,
Nov 27, 2017, 2:17:20 PM11/27/17
to vim-syntastic
Do you mean that I have to use either rvm or rbenv and nothing else?
Reply all
Reply to author
Forward
0 new messages