有没有人成功使用“ruby 协议缓冲区”gem?我在编译基本 proto 文件时遇到问题:
package Test;
message MyMessage
{
optional string myField = 1;
}
当我打电话时,ruby-protoc test.proto
我收到以下错误消息:
Person.proto:5:3: Expected "required", "optional", or "repeated".
Person.proto:6:3: Expected "required", "optional", or "repeated".
/var/lib/gems/1.9.1/gems/ruby-protocol-buffers-1.4.1/lib/protocol_buffers/compiler.rb:15:in `compile': 1 (ProtocolBuffers::CompileError)
from /var/lib/gems/1.9.1/gems/ruby-protocol-buffers-1.4.1/bin/ruby-protoc:38:in `<top (required)>'
from /usr/local/bin/ruby-protoc:23:in `load'
from /usr/local/bin/ruby-protoc:23:in `<main>'
非常感谢,
托梅克