There is RuboCop:
gem install rubocoprubocop -a
It will also fix all the common mistakes.
Just use vim, in command mode press gg=G