Fix ruby code and update rubocop config