Note Replace /path/to/ruby/files with the desired destination of the
.pb.rb files. That directory must exist before running this command.
Note The above steps assume that
github.com/gogo/protobuf/gogoproto/gogo.proto is on the GOPATH.
Note Since protoc v3 now ships with a ruby generator, the built-in
generator will mask the gem’s binary. This requires a small hack in order to be
able to use the protobuf gem, the hack is simply to rename the protobuf gem’s
binary to be ruby2 and ask protoc to generate ruby2 code which will force
it to use the binary. For more information please
read this github issue