GRPC 在这里很适合我:
{
"errorMessage": "Could not find 'grpc' (~> 1.24) among 281 total gem(s)\nChecked in 'GEM_PATH=/var/task/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0:/var/runtime', execute `gem env` for more information",
"errorType": "Init<Gem::MissingSpecError>",
"stackTrace": [
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/dependency.rb:311:in `to_specs'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1402:in `block in activate_dependencies'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1391:in `each'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1391:in `activate_dependencies'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1373:in `activate'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems.rb:215:in `rescue in try_activate'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems.rb:208:in `try_activate'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:161:in `rescue in require'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:35:in `require'",
"/var/task/vendor/bundle/ruby/2.5.0/gems/google-cloud-dialogflow-0.14.0/lib/google/cloud/dialogflow.rb:16:in `<top (required)>'",
"/var/task/google_dialog.rb:3:in `require_relative'",
"/var/task/google_dialog.rb:3:in `<top (required)>'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:168:in `require'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:168:in `rescue in require'",
"/var/lang/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:35:in `require'"
]
}
我看到它在vendor/bundle/ruby/2.5.0/gems/grpc-1.27.0-universal-darwin/src/ruby/lib/grpc.rb
我正在编写一个简单的 Ruby 类来连接到 Dialogflow,而 google gem 相当繁重,有很多依赖项。我已经编写了一些测试,这些测试都在本地通过,并且在我从中提取这段代码的 Rails 应用程序的上下文中通过。我需要 Nokogiri,但 Google 似乎是 GRPC 的大用户。当我手动指定时,它只是找不到该文件。任何帮助是极大的赞赏。