diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc
index ee2502e150a8c283d2e473fa86f3e7c601dfdfc8..14854cfa4acab184c743ec08e3035f0707f01163 100644
--- a/src/compiler/ruby_generator.cc
+++ b/src/compiler/ruby_generator.cc
@@ -133,7 +133,7 @@ grpc::string PackageToModule(const grpc::string& name) {
   grpc::string result;
   result.reserve(name.size());
 
-  for (uint i = 0; i < name.size(); i++) {
+  for (int i = 0; i < name.size(); i++) {
     if (name[i] == '_') {
       next_upper = true;
     } else {