Rubocop is a static code check tool for ruby. Very handy and powerful.
Here is a list of Common Rubocop Errors, for your reference. You can simply search by your Rubocop error message in this post. And get your code improved quickly.
Ruby is a frequently used glue language for DevOps. Both Chef and Puppet are implemented by Ruby. For ruby code check, I use Rubocop and Foodcritic frequently. For Python code, I use pylint. For Shell code, I highly recommend shellcheck.
Tips: Create Jenkins jobs to run periodical check for all your scripts.
I also maintain a free and available demo Jenkins here.