Closed janwerkhoven closed 8 years ago
Hi @janwerkhoven,
Thank you for your nice suggestion. I will update documentation. But, If you have a time, please send me a pull-request. It makes me happy.
Thank you,
My suggestion above does not seem to work anymore... I keep getting these errors. Following the URL did not make me any wiser... Do you have any suggestions how to resolve this?
warning: parser/current is loading parser/ruby21, which recognizes warning: 2.1.7-compliant syntax, but you are running 2.1.2. warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
which rubocop
/Users/Jan/.rvm/gems/ruby-2.2.3/bin/rubocop
Console says 2.2.3, error says 2.1.7 code, but running 2.1.2... What's going on??
I have not been able to find the cause yet. I need your help. I think you are using RVM. Do your Ruby environments have a difference between global and project local? If you have it, I guess that there is the cause around it.
1.
rvm -v
rvm 1.27.0 (latest)
2.
which rubocop
/Users/Jan/.rvm/gems/ruby-2.1.2/bin/rubocop
3.
cd
(to exit my project)
which rubocop
sh: command not found: rubocop
4.
gem install rubocop
Resolves this error 👍
So the Rubocop gem was installed in my Rails project only. Installing it in my user root, resolved the error. Your package no longer throws that error. Now I'm getting these :)
Getting closer
All right fixed! Had to run rubocop --auto-gen-config
in the .rubocop_todo.yml
file in Rails.
I have the version of rubocop installed for my project ( 0.57.2 ), it runs fine from the terminal but I get this when running in Atom version 1.53.0
when I try with path to
which rubocop
/Users/lacoste/.rvm/gems/ruby-2.6.4/bin/rubocop
I get
¯\_(ツ)_/¯
@lacostenycoder
My experience was that even though I had gem 'rubocop'
in Gemfile
, rubocop-auto-correct
seems to ignore that version. Instead it's expecting a globally installed gem. Have you tried running gem install rubocop
?
A good addition to rubocop-auto-correct
is the linter-rubocop. The linter highlights errors, warnings and best practice suggestions with links to the rubocop rules. This has helped me understand why certain rules are best practice before auto-correcting them.
Hi,
I had to update Rubocop Command Path to make your package work. In the documentation you may want to add how users can do that. That would have helped me and will probably save other people some time.
For users to find their Rubocop path they can type
which rubocop
Copying that was not enough. I had to replace
/bin
with/wrappers
to make it work.For Ruby experts this makes perfect sense, but for me this took quiet a while to figure out.
Thanks for the package!