gRPC Ruby快速启动失败:DescriptorPool实例无build方法(NoMethodError)
执行gRPC Ruby示例服务器时遇到NoMethodError错误
执行命令ruby greeter_server.rb启动gRPC Ruby示例服务器时,出现以下错误:
ruby greeter_server.rb /Users/ameynevrekar/grpc/examples/ruby/lib/helloworld_pb.rb:6:in `<top (required)>': undefined method `build' for an instance of Google::Protobuf::DescriptorPool (NoMethodError) Google::Protobuf::DescriptorPool.generated_pool.build do ^^^^^^ from <internal:/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require' from <internal:/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require' from /Users/ameynevrekar/grpc/examples/ruby/lib/helloworld_services_pb.rb:20:in `<top (required)>' from <internal:/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require' from <internal:/opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require' from greeter_server.rb:26:in `<main>'
已完成的操作:
- 安装了grpc和grpc-tools gem:
gem install grpcgem install grpc-tools
- 按照指南克隆了指定版本的仓库并进入示例目录:
# Clone the repository to get the example code: $ git clone -b v1.64.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc # Navigate to the "hello, world" Ruby example: $ cd grpc/examples/ruby
原本预期服务器能正常启动,但实际出现上述错误。
内容的提问来源于stack exchange,提问作者nevrekar_amey
相关产品推荐
相关产品推荐

