$ cat test.proto syntax = 'proto3'; message Hoge { message Foo { int32 aa = 1; int32 bb = 2; } int32 a = 1; int32 b = 2; string c = 3; repeated int32 d = 4; repeated Foo e = 5; } $ protoc --ruby_out=./ test.proto $ cat test.rb # Generated by the protocol buffer compiler. DO NOT EDIT! # source: test.proto require 'google/protobuf' Google::Protobuf::DescriptorPool.generated_pool.build do add_message